This is more faithful to the implementation:
https://github.com/python/cpython/blob/3.5/Lib/datetime.py.
When these classes define __init__, pytype has trouble type-checking
classes that inherit from datetime.datetime (done in, e.g., the third party
datetime_tz library) because it gets confused about what arguments the
constructor expects.
NodeVisitor recurses over an AST tree. When encountering a node, it
checks if a method called `visit_{node.__class__.__name__}` exists, and
calls it if so, otherwise calls the generic visitor.
Add the possible methods to NodeVisitor. This is not exactly correct,
since the methods don't *actually* exist on NodeVisitor, e.g.
`NodeVisitor().visit_Module(...)` doesn't work. But it's nice for
subclasses to know which methods they can override and which type they
should have.
* Add macurl2path stub, types based on urllib
* Fix types, remove undocumented
The whole module is undocumented, no reason to just mention it on one call
* Module was removed in 3.7, stubtest shouldn't care about it
* Module was removed in 3.7, stubtest shouldn't care about it
* ssl: fix arg names, mark positional-only args
* ssl: add undocumented parameter to do_handshake
* ssl: fix type of password in load_cert_chain
* ssl: add session parameter to wrap_socket, wrap_bio in py36 on
* ssl: update whitelists
* Improve imaplib return types
Mark CommandResults as obsolete.
Also fix types of tagged_commands and untagged_responses.
Based on a discussion in #3655.
* Fix type of tagged_commands
* Fix IMAP4.tagged_commands type
* Mark CommandResults as private
* Fix
* fcntl: mark positional-only args
* fcntl: use overload for fcntl.fcntl
The comment about depending on the type of arg seems incorrect
bf501353a0
I checked the docs and examples, CPython implementation and CPython tests, but
I might be missing something
* fcntl: use overload for fcntl.ioctl
Based off of docs and examples
* fcntl: type buffers better
Follows the approach in #2610
* sre_parse: NIC is stub implementation detail
* sre_parse: add missing arg to Tokenizer.getuntil
* sre_parse: fix types for parse
* sre_parse: fix types for SubPattern.__init__
* sre_parse: fix arg name for fix_flags
* sre_parse: update whitelists
* sre_parse: fix some availability for py35
* json: mark keyword-only args
Technically only true for Python 3.6+, but I didn't feel like copying
over the whole file just for Python 3.5. Let me know and I can.
* json: remove encoding from loads
This has been ignored and deprecated since 3.1 and will be removed in 3.9
It no longer even shows up in inspect.signature (in 3.8 it emits the
deprecation warning based on kwargs)
* json: update whitelists
* sys: simplify _getframe
* sys: mark positional-only args
* sys: fix platform availability
* sys: remove settscdump
This function is no longer documented in 3.6 and above (and doesn't
exist on master, was removed in 4fd64b9a6aba9e6e1a5d).
In 3.5 documentation it's mentioned that it's only available if Python
was compiled with a special flag:
https://docs.python.org/3.5/library/sys.html#sys.settscdump
* sys: update whitelists