-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
migrate some stuffs in ctypes/__init__.pyi
into _ctypes.pyi
, but circular import occurs
#8633
Comments
You don't really need to worry about circular imports, since stub files are never imported by Python. All type checkers know how to resolve circular imports when resolving references. That said, in this case you could probably move the fake definitions |
I submitted issue to |
The This will be fixed "in a few weeks". |
List of the stuffs in
|
If you update to pytype 2022.08.30, you should be able to import |
Currently, |
Yes, the pytype update did the trick — thanks v much @rchen152! |
I just updated typeshed's pinned version of pytype to 2023.4.27 in #10111. pytype v2023.4.27 includes google/pytype@2e2088f, which removes pytype's copy of |
When we submitted PR that adds the
stdlib/_ctypes.pyi
(#8582), imports some stuffs fromctypes
.But the implementation imports some stuffs from
_ctypes
toctypes
.stdlib/_ctypes
#8571 (comment)However, trying to write type stubs as close as possible to the implementation would result in circular imports if we just move definitions around.
CDLL
in args of_CData
methods.CDLLL
is defined inctypes
_CData
(base class of_SimpleCData
) is defined in_ctypes
.pyi
files" even if they are circular imports.Any opinions would be appreciated.
The text was updated successfully, but these errors were encountered: