mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Fix type of concurrent.futures.wait for Python <= 3.8 (#11537)
Closes #11533.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
import threading
|
||||
from _typeshed import Unused
|
||||
from collections.abc import Callable, Iterable, Iterator
|
||||
from collections.abc import Callable, Collection, Iterable, Iterator
|
||||
from logging import Logger
|
||||
from types import TracebackType
|
||||
from typing import Any, Generic, Literal, NamedTuple, Protocol, TypeVar
|
||||
@@ -91,9 +91,15 @@ class DoneAndNotDoneFutures(NamedTuple, Generic[_T]):
|
||||
done: set[Future[_T]]
|
||||
not_done: set[Future[_T]]
|
||||
|
||||
def wait(
|
||||
fs: Iterable[Future[_T]], timeout: float | None = None, return_when: str = "ALL_COMPLETED"
|
||||
) -> DoneAndNotDoneFutures[_T]: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def wait(
|
||||
fs: Iterable[Future[_T]], timeout: float | None = None, return_when: str = "ALL_COMPLETED"
|
||||
) -> DoneAndNotDoneFutures[_T]: ...
|
||||
|
||||
else:
|
||||
def wait(
|
||||
fs: Collection[Future[_T]], timeout: float | None = None, return_when: str = "ALL_COMPLETED"
|
||||
) -> DoneAndNotDoneFutures[_T]: ...
|
||||
|
||||
class _Waiter:
|
||||
event: threading.Event
|
||||
|
||||
Reference in New Issue
Block a user