-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
reason: inexpressibleClosed, because this can't be expressed within the current type systemClosed, because this can't be expressed within the current type system
Description
Right now Array in ctypes is a regular class:
typeshed/stdlib/ctypes/__init__.pyi
Lines 269 to 271 in 5c8e68f
| class Array(Generic[_CT], _CData): | |
| _length_: ClassVar[int] |
But, in reallity - you cannot instantiate it:
>>> from ctypes import Array, c_int
>>> i = c_int(1)
>>> Array(i)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: abstract classMypy is also not happy with Array(...) but for other reasons:
out/ex.py:4: error: Array constructor argument 1 of type "c_int" is not convertible to the array element type <nothing>
out/ex.py:4: note: Revealed type is "ctypes.Array[<nothing>]"
Array(...) is not tested in https://github.com/python/mypy/blob/master/test-data/unit/check-ctypes.test at all
Metadata
Metadata
Assignees
Labels
reason: inexpressibleClosed, because this can't be expressed within the current type systemClosed, because this can't be expressed within the current type system