mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-10-03 08:23:47 +08:00
Improve stubs for sequence types (#6386)
This commit is contained in:
1 parent
6130c2459e
commit
98af7d667f
9 files changed
+32
-29
No files matched your search
@@ -5,6 +5,7 @@ from abc import abstractmethod
|
||||
from collections.abc import Container, Iterable, Iterator, Sequence
|
||||
from logging import Logger
|
||||
from typing import Any, Callable, Generic, Protocol, Set, TypeVar, overload
|
||||
from typing_extensions import SupportsIndex
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from types import GenericAlias
|
||||
@@ -81,7 +82,7 @@ class DoneAndNotDoneFutures(Sequence[Set[Future[_T]]]):
|
||||
def __new__(_cls, done: set[Future[_T]], not_done: set[Future[_T]]) -> DoneAndNotDoneFutures[_T]: ...
|
||||
def __len__(self) -> int: ...
|
||||
@overload
|
||||
def __getitem__(self, i: int) -> set[Future[_T]]: ...
|
||||
def __getitem__(self, i: SupportsIndex) -> set[Future[_T]]: ...
|
||||
@overload
|
||||
def __getitem__(self, s: slice) -> DoneAndNotDoneFutures[_T]: ...
|
||||
|
||||
|
||||
Reference in new issue
Block a user