mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Improve two classes which are namedtuples at runtime, but cannot be namedtuples in typeshed (#7429)
This commit is contained in:
@@ -79,8 +79,10 @@ def as_completed(fs: Iterable[Future[_T]], timeout: float | None = ...) -> Itera
|
||||
|
||||
# Ideally this would be a namedtuple, but mypy doesn't support generic tuple types. See #1976
|
||||
class DoneAndNotDoneFutures(Sequence[set[Future[_T]]]):
|
||||
done: set[Future[_T]]
|
||||
not_done: set[Future[_T]]
|
||||
@property
|
||||
def done(self) -> set[Future[_T]]: ...
|
||||
@property
|
||||
def not_done(self) -> set[Future[_T]]: ...
|
||||
def __new__(_cls, done: set[Future[_T]], not_done: set[Future[_T]]) -> DoneAndNotDoneFutures[_T]: ...
|
||||
def __len__(self) -> int: ...
|
||||
@overload
|
||||
|
||||
Reference in New Issue
Block a user