interfaces: direct import the basetypes into the `types` module
authorMatt Harbison <matt_harbison@yahoo.com>
Thu, 06 Feb 2025 15:24:58 -0500
changeset 52750 2a5450ecde20
parent 52749 aa948d9e3fee
child 52751 38095e4e9046
interfaces: direct import the basetypes into the `types` module This is equivalent code, but PyCharm fails to propagate the doc comments to tooltips in client modules that import from `types` with the previous aliasing.
mercurial/interfaces/types.py
tests/test-check-pyflakes.t
--- a/mercurial/interfaces/types.py	Thu Feb 06 15:17:37 2025 -0500
+++ b/mercurial/interfaces/types.py	Thu Feb 06 15:24:58 2025 -0500
@@ -11,13 +11,14 @@
 
 from __future__ import annotations
 
+from ._basetypes import (
+    FsPathT,
+    HgPathT,
+    UserMsgT,
+)
+
 from . import (
-    _basetypes,
     matcher,
 )
 
 MatcherT = matcher.IMatcher
-
-UserMsgT = _basetypes.UserMsgT
-HgPathT = _basetypes.HgPathT
-FsPathT = _basetypes.FsPathT
--- a/tests/test-check-pyflakes.t	Thu Feb 06 15:17:37 2025 -0500
+++ b/tests/test-check-pyflakes.t	Thu Feb 06 15:24:58 2025 -0500
@@ -20,6 +20,9 @@
   > 2>/dev/null \
   > | xargs pyflakes 2>/dev/null | "$TESTDIR/filterpyflakes.py"
   contrib/perf.py:*:* undefined name 'xrange' (glob) (?)
+  mercurial/interfaces/types.py:*:*: '._basetypes.FsPathT' imported but unused (glob)
+  mercurial/interfaces/types.py:*:*: '._basetypes.HgPathT' imported but unused (glob)
+  mercurial/interfaces/types.py:*:*: '._basetypes.UserMsgT' imported but unused (glob)
   mercurial/pycompat.py:*:* 'codecs' imported but unused (glob)
   mercurial/pycompat.py:*:* 'concurrent.futures' imported but unused (glob)
   mercurial/pycompat.py:*:* 'http.client as httplib' imported but unused (glob)