* 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
* adding ascii, panal and textpad modules to the curses module.
* added curses/panel.pyi and curses/textpad.pyi to test/pytype_blacklist.txt
just like curses/__init__.pyi because they all import _curses. (This
may not be the right thing to do)
Also, change the type of StringIO.name (Python 3) from str to Any.
Neither StringIO nor BytesIO actually define a name field, but the
super-class IO[T] of both in typeshed does define a read-only property.
This means that sub-classes of StringIO and BytesIO adding this field
will not typecheck correctly.
Closes: #1790
This removes the circular dependency between the os and posix stub, which
is somehow triggering python/mypy#4442. We should ideally fix the mypy bug,
but since it's easy enough to fix the import cycle, we might as well do that
too.
* Added missing annotation for start_color() and wrapper() functions
* 1) Changed Optional types to be optional arguments (checked documentation and manual experiments to make sure I was doing it right)
2) Modified format to match CONTRIBUTING.md conventions
3) corrected a few missing return types or other mistaken type
annotations
* Extract WSGIEnvironment in wsgiref.types
* Change value type of WSGIEnvironment to Any
Per PEP 3333, a WSGI environment can contain anything, not just strings.
* Fix blake2 binding
Currently calling `hashlib.blake2b` results in the following type errors:
Cannot instantiate abstract class '_BlakeHash' with abstract attributes 'copy', 'digest', 'hexdigest' and 'update'
Missing positional arguments "data", "key", "salt", "person", "fanout", "depth", "leaf_size", "node_offset", "node_depth", "inner_size", "last_node" in call to "_BlakeHash"
* Additional changes to reflect the hashlib implementation
Modifies the type signatures of:
* blake2b
* blake2s
* sha3_224
* sha3_256
* sha3_384
* sha3_512
* shake_128
* shake_256
To reflect the types that are implemented in the standard library.
These should be exposed as `type`s instead of `builtin_function_or_method`s.
e.g.
In [40]: type(hashlib.blake2b)
Out[40]: type
In [41]: type(hashlib.md5)
Out[41]: builtin_function_or_method
str.translate requires a Mapping or Sequence (in essence, anything
with __getitem__), not a Dict.
str.maketrans in the one-argument form only converts character string
keys to their unicode ordinal, leaving any of the values untouched.
This mapping may use both integers or strings as keys at the same time.
str.maketrans in the multi-argument form returns a dict with any of the
values str, int or None, as recognized by str.translate.
List is used but not imported. According to PEP-484 "Suggested syntax for Python 2.7 and straddling code" it should be imports.
"Like other type comments, any names used in the annotations must be imported or defined by the module containing the annotation.".
Also order the typing import list, because it looks nicer.