* Use typing.ContextManager for multiprocessing context managers
Prior to this commit, the types for __enter__ and __exit__ were not
fully defined; this addresses that.
* Move Pool class stub to multiprocessing.pool
This is where the class is actually defined in the stdlib.
* Ensure that __enter__ on Pool subclasses returns the subclass
This ensures that:
```py
class MyPool(Pool):
def my_method(self): pass
with MyPool() as pool:
pool.my_method()
```
type-checks correctly.
* Update the signature of BaseContext.Pool to match Pool.__init__
* Restore multiprocessing.Pool as a function
And also add comments to note that it should have an identical signature
to multiprocessing.context.BaseContext.Pool (because it is just that
method partially applied).
Also change multiprocessing.Queue's put and get timeout arguments to
allow None.
This fixes a problem with logging.handlers.QueueHandler and
QueueListener not accepting a multiprocessing.Queue as the queue
argument.
Declaring the Queue now needs to note what it will be used for. eg.
q = multiprocessing.Queue() # type: multiprocessing.Queue[List[Any]]
* Adds Event type to multiprocessing
* Add event and context stub to multiprocessing stub. Updates per recommendations.
* Adding missing newline at EOF.
* Stubbing just BaseContext and not any of the member functions.
* Fix flake8 extra line.
* Fix comment.
* Add todo for BaseContext, make ctx of Any type, and remove multiprocessing.context
* 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.