diff --git a/stdlib/3/concurrent/futures/_base.pyi b/stdlib/3/concurrent/futures/_base.pyi index 00ef5b6c3..547d68e7a 100644 --- a/stdlib/3/concurrent/futures/_base.pyi +++ b/stdlib/3/concurrent/futures/_base.pyi @@ -1,9 +1,9 @@ from typing import TypeVar, Generic, Any, Iterable, Iterator, Callable, Tuple, Optional, Set from collections import namedtuple -FIRST_COMPLETED = ... # type: Any -FIRST_EXCEPTION = ... # type: Any -ALL_COMPLETED = ... # type: Any +FIRST_COMPLETED = ... # type: str +FIRST_EXCEPTION = ... # type: str +ALL_COMPLETED = ... # type: str PENDING = ... # type: Any RUNNING = ... # type: Any CANCELLED = ... # type: Any @@ -27,14 +27,14 @@ class Future(Generic[_T]): def done(self) -> bool: ... def add_done_callback(self, fn: Callable[[Future], Any]) -> None: ... def result(self, timeout: Optional[float] = ...) -> _T: ... - def exception(self, timeout: Optional[float] = ...) -> BaseException: ... + def exception(self, timeout: Optional[float] = ...) -> Optional[BaseException]: ... def set_running_or_notify_cancel(self) -> None: ... def set_result(self, result: _T) -> None: ... - def set_exception(self, exception: BaseException) -> None: ... + def set_exception(self, exception: Optional[BaseException]) -> None: ... 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] = ..., chunksize: int = ...) -> Iterable[_T]: ... + def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ..., chunksize: int = ...) -> 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: ... diff --git a/stdlib/3/concurrent/futures/process.pyi b/stdlib/3/concurrent/futures/process.pyi index b157d2b33..8076c2d05 100644 --- a/stdlib/3/concurrent/futures/process.pyi +++ b/stdlib/3/concurrent/futures/process.pyi @@ -1,14 +1,9 @@ -from typing import Any, Callable, TypeVar, Iterable, Optional +from typing import Optional, Any from ._base import Future, Executor EXTRA_QUEUED_CALLS = ... # type: Any class BrokenProcessPool(RuntimeError): ... -_T = TypeVar('_T') - class ProcessPoolExecutor(Executor): def __init__(self, max_workers: Optional[int] = ...) -> None: ... - def submit(self, fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ... - def map(self, func: Callable[..., _T], *iterables: Any, timeout: Optional[float] = ..., chunksize: int = ...) -> Iterable[_T]: ... - def shutdown(self, wait: bool = ...) -> None: ... diff --git a/stdlib/3/concurrent/futures/thread.pyi b/stdlib/3/concurrent/futures/thread.pyi index e366d4d3a..1774b639c 100644 --- a/stdlib/3/concurrent/futures/thread.pyi +++ b/stdlib/3/concurrent/futures/thread.pyi @@ -1,10 +1,5 @@ -from typing import Any, TypeVar, Callable, Iterable, Optional +from typing import Optional from ._base import Executor, Future -_T = TypeVar('_T') - class ThreadPoolExecutor(Executor): def __init__(self, max_workers: Optional[int] = ...) -> None: ... - def submit(self, fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ... - def map(self, func: Callable[..., _T], *iterables: Any, timeout: Optional[float] = ..., chunksize: int = ...) -> Iterable[_T]: ... - def shutdown(self, wait: bool = ...) -> None: ... diff --git a/third_party/2/concurrent/futures/__init__.pyi b/third_party/2/concurrent/futures/__init__.pyi index 02c11a2a6..4604830ed 100644 --- a/third_party/2/concurrent/futures/__init__.pyi +++ b/third_party/2/concurrent/futures/__init__.pyi @@ -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]]: ...