* Add `None` to type union for `subprocess.Popen.communicate` stub's `input` parameter.
* subprocess.communicate `input` annotated as `Optional[AnyStr]` for both 2.7 and 3.x; `timeout` as `Optional[float]`.
- Cursor is an Iterator of Any now, and .__iter__(..) and .__next__(..)
have been changed / made explicit to reflect this.
- .fetchall(..)/.fetchmany(..)/.fetchone(..) return (lists of) Anys
instead of tuples.
As per discussion in PR #663, the output of fetching values from the
cursor can be customized with a custom assignment to
.row_factory. Therefore the correct return type for fetching is Any and
not tuple.
I added strong types to the class that users are likely to interact with and left
the rest untyped for now. This is needed to support Flask.
Permission is given here - https://github.com/pallets/flask/issues/2012
* add stubs for Python 2 profile and cProfile
Partially fixes#531. Contrary to the Python 2.7 docs at
https://docs.python.org/2/library/profile.html#module-cProfile,
these modules do not have exactly the same interface. For
example, profile.Profile() does not have an enable() method.
* profile stubs: move to 2and3, add __init__, use private names for typevars
I'm preparing a PR to mypy that further formalizes and improves the rules for
which functions are "compatible" with each other, both for subtyping and for
assignment. This is the one place in the stubs that violates the new rules but
not the old: the supertype `Serializer` can take an optional positional argument
called `serializer` to `load_payload`, but until this diff the mixin used to
implement it could not, but rather could only take `serializer` as a named
argument, through its **kwargs.
Fixes#720.
Related changes: used a NamedTuple for time.struct_time on Python 3, used
sys.version selectors for proper typing of #716, added missing *Style classes
to logging on Python 3.
* Fix type declarations for multiprocessing.pool.ThreadPool
The existing incomplete type declarations were replaced by a copy of
multiprocessing.Pool's declarations, suitably modified.
Fixes#683.
* Change iterable type to Iterable[Iterable[Any]] in starmap
multiprocessing.Pool and multiprocessing.pool.ThreadPool have starmap
and related methods, where the iterable argument is expected to yield
iterables. The type declarations now reflect this.