Remove redundant inheritances from Generic and various typing protocols (#10981)

This commit is contained in:
Alex Waygood
2023-11-06 13:00:25 +00:00
committed by GitHub
parent c8073493fc
commit 8023ba764a
9 changed files with 16 additions and 25 deletions

View File

@@ -513,7 +513,7 @@ class Collection(Iterable[_T_co], Container[_T_co], Protocol[_T_co]):
@abstractmethod
def __len__(self) -> int: ...
class Sequence(Collection[_T_co], Reversible[_T_co], Generic[_T_co]):
class Sequence(Collection[_T_co], Reversible[_T_co]):
@overload
@abstractmethod
def __getitem__(self, index: int) -> _T_co: ...
@@ -607,7 +607,7 @@ class ItemsView(MappingView, AbstractSet[tuple[_KT_co, _VT_co]], Generic[_KT_co,
def __xor__(self, other: Iterable[_T]) -> set[tuple[_KT_co, _VT_co] | _T]: ...
def __rxor__(self, other: Iterable[_T]) -> set[tuple[_KT_co, _VT_co] | _T]: ...
class KeysView(MappingView, AbstractSet[_KT_co], Generic[_KT_co]):
class KeysView(MappingView, AbstractSet[_KT_co]):
def __init__(self, mapping: Mapping[_KT_co, Any]) -> None: ... # undocumented
def __and__(self, other: Iterable[Any]) -> set[_KT_co]: ...
def __rand__(self, other: Iterable[_T]) -> set[_T]: ...
@@ -623,7 +623,7 @@ class KeysView(MappingView, AbstractSet[_KT_co], Generic[_KT_co]):
def __xor__(self, other: Iterable[_T]) -> set[_KT_co | _T]: ...
def __rxor__(self, other: Iterable[_T]) -> set[_KT_co | _T]: ...
class ValuesView(MappingView, Collection[_VT_co], Generic[_VT_co]):
class ValuesView(MappingView, Collection[_VT_co]):
def __init__(self, mapping: Mapping[Any, _VT_co]) -> None: ... # undocumented
def __contains__(self, value: object) -> bool: ...
def __iter__(self) -> Iterator[_VT_co]: ...