mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Remove context manager hints in multiprocessing.pool in Python 2 (#4060)
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
from typing import (
|
||||
Any, Callable, ContextManager, Iterable, Optional, Dict, List,
|
||||
TypeVar, Iterator,
|
||||
)
|
||||
from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, TypeVar
|
||||
|
||||
_T = TypeVar('_T', bound=Pool)
|
||||
|
||||
@@ -17,7 +14,7 @@ class IMapIterator(Iterator[Any]):
|
||||
|
||||
class IMapUnorderedIterator(IMapIterator): ...
|
||||
|
||||
class Pool(ContextManager[Pool]):
|
||||
class Pool(object):
|
||||
def __init__(self, processes: Optional[int] = ...,
|
||||
initializer: Optional[Callable[..., None]] = ...,
|
||||
initargs: Iterable[Any] = ...,
|
||||
@@ -50,10 +47,8 @@ class Pool(ContextManager[Pool]):
|
||||
def close(self) -> None: ...
|
||||
def terminate(self) -> None: ...
|
||||
def join(self) -> None: ...
|
||||
def __enter__(self: _T) -> _T: ...
|
||||
|
||||
class ThreadPool(Pool, ContextManager[ThreadPool]):
|
||||
|
||||
class ThreadPool(Pool):
|
||||
def __init__(self, processes: Optional[int] = ...,
|
||||
initializer: Optional[Callable[..., Any]] = ...,
|
||||
initargs: Iterable[Any] = ...) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user