Adds some version ranges for submodules that are available in different
versions that their parent modules.
I noticed these while updating pytype's pinned typeshed commit. pytype
can't actually use this submodule version information yet, but from what
I understand, all type checkers at least handle this information
gracefully (by ignoring it), so it doesn't hurt to add it.
* collections.abc is available in Python 3.3 and later. _collections_abc
is imported by the collections.abc stub, so its version range is also
changed from 3.6- to 3.3-.
* _typeshed.tkinter needs to be 3.0-, since it imports tkinter, which is
marked as 3.0-.
* importlib.metadata is available in 3.8 and later.
* Extract _socket.pyi from socket.pyi.
* Extract _socket.socket from socket.socket.
* Fix socket.family annotation.
* Annotate SocketIO properly.
* SocketType is an alias of _socket.socket.
* Sort items in socket.pyi in the same order as in socket.py.
* Remove socket.EINTR.
* Use _typeshed.WriteableBuffer instead of custom alias.
* Add errorTab (Windows only).
* Add _socket.dup().
* Mark positional-only argments.
* Remove constructors from socket exceptions.
* socket.timeout is an alias for TimeoutError, starting with Python 3.10.
* Use PEP 604 in changed lines.
* Add alias for fileno arguments.
* getaddrinfo() port can be bytes.
* Explicitly override some SSLSocket methods.
* Allow ReadableBuffer in _CMSG arguments.
* Mark stdlib modules with upper version bounds
* Add minus to all versions and enforce in check_consistent
* Fix check_consistent and mypy_test to work with new VERSIONS format
I'm not sure what the best way to do this is. This effectively orphans
types-typing-extensions, but maybe that's not really a problem. (We can
yank the package too)
See https://github.com/python/typeshed/pull/5229#issuecomment-822234125
for some details
Co-authored-by: hauntsaninja <>
* Split cgi.pyi into Py2 and 3 versions
* Restore correct Python 2 version of cgi.pyi
* Remove unnecessary version checks in cgi.pyi
* Use collections.abc
* Use List in Python 2 stub