mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-28 06:36:54 +08:00
typing: remove __class_getitem__ from Protocols (#4741)
Co-authored-by: hauntsaninja <>
This commit is contained in:
@@ -165,8 +165,6 @@ class Hashable(Protocol, metaclass=ABCMeta):
|
||||
class Iterable(Protocol[_T_co]):
|
||||
@abstractmethod
|
||||
def __iter__(self) -> Iterator[_T_co]: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
@runtime_checkable
|
||||
class Iterator(Iterable[_T_co], Protocol[_T_co]):
|
||||
@@ -206,8 +204,6 @@ class Generator(Iterator[_T_co], Generic[_T_co, _T_contra, _V_co]):
|
||||
class Awaitable(Protocol[_T_co]):
|
||||
@abstractmethod
|
||||
def __await__(self) -> Generator[Any, None, _T_co]: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
class Coroutine(Awaitable[_V_co], Generic[_T_co, _T_contra, _V_co]):
|
||||
__name__: str
|
||||
@@ -243,8 +239,6 @@ class AwaitableGenerator(
|
||||
class AsyncIterable(Protocol[_T_co]):
|
||||
@abstractmethod
|
||||
def __aiter__(self) -> AsyncIterator[_T_co]: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
@runtime_checkable
|
||||
class AsyncIterator(AsyncIterable[_T_co], Protocol[_T_co]):
|
||||
@@ -282,8 +276,6 @@ class AsyncGenerator(AsyncIterator[_T_co], Generic[_T_co, _T_contra]):
|
||||
class Container(Protocol[_T_co]):
|
||||
@abstractmethod
|
||||
def __contains__(self, __x: object) -> bool: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
@runtime_checkable
|
||||
class Collection(Iterable[_T_co], Container[_T_co], Protocol[_T_co]):
|
||||
@@ -368,8 +360,6 @@ class MutableSet(AbstractSet[_T], Generic[_T]):
|
||||
class MappingView(Sized):
|
||||
def __init__(self, mapping: Mapping[_KT_co, _VT_co]) -> None: ... # undocumented
|
||||
def __len__(self) -> int: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
class ItemsView(MappingView, AbstractSet[Tuple[_KT_co, _VT_co]], Generic[_KT_co, _VT_co]):
|
||||
def __init__(self, mapping: Mapping[_KT_co, _VT_co]) -> None: ... # undocumented
|
||||
|
||||
Reference in New Issue
Block a user