* 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
We (I) introduced the BLOCKED label ~2 years ago, but it never got much usage, and I remember it startled some developers (Ivan may recall...). A better convention seems to put [WIP] in the subject, so let's standardize on that and get rid of the BLOCKED label.
I already removed the BLOCKED label and edited the subject of the one issue under it.
We also don't make good use of the other labels, but they seem more useful and less controversial.
* Use variable annotations
* Replace default values by ellipses
* Remove exceptions from function bodies
* Remove superfluous comments
* Remove superfluous newlines
* Use Optional instead of Union[..., None]
* Replace Union[int, float] by just float
* Make time.pyi (Python 2) more closely resemble the Python 3 stub
* Replace _TIME_TUPLE by TimeTuple
* Reorder imports
* time.pyi: Mark two arguments as optional, mark Unix-only function
* time.pyi (Python 2): Use TimeTuple in NamedTuple and reformat
This makes time.pyi more closely match the Python3 version.
* Merge Python 2 and 3 versions of time.pyi
* Only import SimpleNamespace on Python >= 3.3
* Remove default values from module properties
* Remove Optional from strftime() and asctime()
* accept2dyear was removed in Python 3.3
* Rename TimeTuple to _TimeTuple
* contextlib.pyi ExitStack.callback take Callable
The documentation for ExitStack does not specify the return type of the callable's passed to callback.
Saying that they always return None breaks a very common use case for ExitStack, which is to "schedule" changes to a collection
while iterating it.
```
with ExitStack() as stack:
for key, value in adict.items():
if ...:
stack.callback(adict.pop, key)
```
I also added AsyncExitStack, using Awaitable.
* Moving to Explicit Any in Generics
Add all cursor types and missing show_warnings method in connections
Added show_warnings to connections. No return type specified as this
requires tracing back through missing return types in previous
author's work. This is out of scope for this pull request.
Added SSDictCursor, SSCursor and DictCursorMixin to complete the
Cursors definition.