CDLL.__getattr__ and __getitem__ return function pointers that have a __name__ attribute set, so "CDLL(lib).fun.__name__" is valid code but currently not covered.
* Allow only _CData subclasses as ctypes.Array elements
* Change type of ctypes.Array.raw and .value to Any (Closes#2111)
.raw and .value don't exist on all arrays. On c_char arrays, both exist
and have type bytes; on c_wchar arrays, only .value exists and has
type Text; on all other arrays neither one exists.
This is impossible to describe properly in a stub, so marking .value as
Any is the best that can be done.
* Make {C,WIN,PY}FUNCTYPE's restype argument optional (for void returns)
* Make WinError return WindowsError
* Don't have Array explicitly inherit from Sized
(since inheriting from classes with different metaclasses causes problems,
and it is a protocol anyways)
* Have Array.__iter__ properly return an Iterator instead of an Iterable
* Support additional argument types for c_void_p parameters
* Don't allow passing bytes where a writable c_void_p is expected
* Fix type of ctypes._CDataMeta.__[r]mul__
* Rename ctypes._cparam to _CArgObject to match the real type name
* Fix value type of ctypes.HRESULT
* Add stub for ctypes.wintypes
* Fix trailing whitespace in ctypes.wintypes
* Add a workaround to ctypes.Array to fix incorrect typing in some cases
* Expand multiple assignments so mypy recognizes them as type aliases
* Rename ctypes._Pointer to pointer so it can be used externally
* Convert type comments to variable annotations in ctypes.__init__
* Add missing List import in ctypes.__init__
* Add missing bound kwarg to _CT TypeVar in ctypes.__init__
* Fix ctypes._CData classmethod definitions
* Fix ctypes Structure/Union __getattr__ definitions
Both Structure's metaclass and Structure itself define a __getattr__.
The former returns field objects (each representing a field definition
in the Structure), while the latter can return anything (the value of
the field in a specific Structure instance).
Structure also defines a __setattr__, while Structure's metaclass
does not.
BigEndianStructure, LittleEndianStructure and Union support the same
operations as Structure does, but the semantics obviously differ.
Depending on the system endianness, exactly one of the EndianStructures
is an alias for Structure, and the other one is a special Structure
subclass. For simplicity, both EndianStructures are considered
subclasses of Structure here, even though this is technically not
always accurate.
* Fix swapped parameter types in ctypes._CData.in_dll
* Add limited support for ctypes._CData.__class__.__mul__
It's not possible to specify the correct return type for __mul__ and
__rmul__ here - see comments for explanation.
* Make ctypes._FuncPtr extend ctypes._CData
* Improve typing of ctypes.cast
* Mark class attributes with ClassVar in ctypes.__init__
* Mark ctypes._CData.from_buffer[_copy] offset arg as optional
* Remove trailing whitespace in ctypes.__init__
* Don't export ctypes.UnionT
* Add ctypes._DLL.__getitem__
* Make ctypes._DLL.__get(attr|item)__ return _FuncPtr instead of Any
* Change ctypes DLL inheritance hierarchy to match the real one better
* Add some missing attributes to ctypes.CDLL
* Rename ctypes._FuncPtr so it doesn't conflict with CDLL._FuncPtr
* Fix type of ctypes.CDLL._FuncPtr
* Merge _FuncProto into _FuncPointer
The function pointer types returned by CFUNCTYPE and friends are the
same as those encountered elsewhere, so there's no need to treat them
differently.
* Fix some leftover references to ctypes._DLL
* Simplify definition of ctypes._DLLT
* Add ctypes.LibraryLoader.__get(attr|item)__
* Use Text instead of str where appropriate in ctypes.__init__
* Make ctypes.c_char accept ints
* Make ctypes.c_[w]char_p accept None
* Remove unneeded Generic base from ctypes.py_object
* Make ctypes.cast accept _cparam
* Fix ctypes._PF being declared too late
* Remove incorrect ctypes.PyDLL.__init__ override
* util done
* __init__, 16.16.2.2 done
* 16.16.2.3 done
* 16.16.2.4
* fix *FUNCTYPE, fix generic
* remove part of generic
* temporarly broad some type
* 16.16.2.5
* 16.16.2.6
* 16.16.2.7
* 16.16.2.8
* 16.16.2.9 and cleanup
* no documentation on wintypes
* move from _SimpleCData to _CData
* base on some example
* py2 done, cleanup
* make pytype happy