Skip to content

concurrent.futures: update for py39, minor fixes #4503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions stdlib/3/concurrent/futures/_base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,20 @@ class Future(Generic[_T]):
def set_exception_info(self, exception: Any, traceback: Optional[TracebackType]) -> None: ...

class Executor:
def submit(self, fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ...
if sys.version_info >= (3, 9):
def submit(self, __fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ...
else:
def submit(self, fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ...
if sys.version_info >= (3, 5):
def map(
self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ..., chunksize: int = ...
self, fn: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ..., chunksize: int = ...
) -> Iterator[_T]: ...
else:
def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ...) -> Iterator[_T]: ...
def shutdown(self, wait: bool = ...) -> None: ...
if sys.version_info >= (3, 9):
def shutdown(self, wait: bool = ..., *, cancel_futures: bool = ...) -> None: ...
else:
def shutdown(self, wait: bool = ...) -> None: ...
def __enter__(self: _T) -> _T: ...
def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> Optional[bool]: ...

Expand Down
12 changes: 9 additions & 3 deletions third_party/2/concurrent/futures/_base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,20 @@ class Future(Generic[_T]):
def set_exception_info(self, exception: Any, traceback: Optional[TracebackType]) -> None: ...

class Executor:
def submit(self, fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ...
if sys.version_info >= (3, 9):
def submit(self, __fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ...
else:
def submit(self, fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ...
if sys.version_info >= (3, 5):
def map(
self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ..., chunksize: int = ...
self, fn: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ..., chunksize: int = ...
) -> Iterator[_T]: ...
else:
def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ...) -> Iterator[_T]: ...
def shutdown(self, wait: bool = ...) -> None: ...
if sys.version_info >= (3, 9):
def shutdown(self, wait: bool = ..., *, cancel_futures: bool = ...) -> None: ...
else:
def shutdown(self, wait: bool = ...) -> None: ...
def __enter__(self: _T) -> _T: ...
def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> Optional[bool]: ...

Expand Down