mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-26 11:37:16 +08:00
More precise signatures in concurrent.futures (#1262)
* Allow None in concurrent.futures.exception() and set_exception() * Make Executor.map() signature more precise * Remove superfluous signatures * Specify str type for some concurrent.futures constants * Update concurrent.futures backport * CR fixes
This commit is contained in:
@@ -26,16 +26,16 @@ class Future(Generic[_T]):
|
||||
|
||||
class Executor:
|
||||
def submit(self, fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ...
|
||||
def map(self, func: Callable[..., _T], *iterables: Any, timeout: Optional[float] = ...) -> Iterable[_T]: ...
|
||||
def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ...) -> Iterator[_T]: ...
|
||||
def shutdown(self, wait: bool = ...) -> None: ...
|
||||
def __enter__(self) -> Executor: ...
|
||||
def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> bool: ...
|
||||
|
||||
class ThreadPoolExecutor(Executor):
|
||||
def __init__(self, max_workers: int) -> None: ...
|
||||
def __init__(self, max_workers: Optional[int] = ...) -> None: ...
|
||||
|
||||
class ProcessPoolExecutor(Executor):
|
||||
def __init__(self, max_workers: Union[int, None] = ...) -> None: ...
|
||||
def __init__(self, max_workers: Optional[int] = ...) -> None: ...
|
||||
|
||||
def wait(fs: Iterable[Future], timeout: Optional[float] = ..., return_when: str = ...) -> Tuple[Set[Future], Set[Future]]: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user