mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 04:34:28 +08:00
* 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).