You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The class hierarchy in the _ctypes stub don't mirror the real module exactly. This doesn't prevent mypy from type-checking but it may prevent modules compiled with mypyc from running. Here is a test file
$ python3
Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license"for more information.
>>> import test
Traceback (most recent call last):
File "<stdin>", line 1, in<module>
File "test.py", line 7, in<module>
class c_win_timespec(ctypes.Structure):
AttributeError: module '_ctypes' has no attribute '_StructUnionBase'
This is because there is no _StructUnionBase in the real _ctypes module but there is one in the stub.
Who is at fault here? Is the stub file broken? Or does mypyc need to be extended to handle this case?
The text was updated successfully, but these errors were encountered:
The class hierarchy in the _ctypes stub don't mirror the real module exactly. This doesn't prevent mypy from type-checking but it may prevent modules compiled with mypyc from running. Here is a test file
Now if I try to import the built module:
This is because there is no
_StructUnionBase
in the real _ctypes module but there is one in the stub.Who is at fault here? Is the stub file broken? Or does mypyc need to be extended to handle this case?
The text was updated successfully, but these errors were encountered: