Remove many redundant inheritances from Generic[] (#10933)

This commit is contained in:
Alex Waygood
2023-10-26 19:07:20 +01:00
committed by GitHub
parent 5dbdd59c9b
commit a08d4c8d2e
30 changed files with 81 additions and 81 deletions

View File

@@ -527,7 +527,7 @@ class Sequence(Collection[_T_co], Reversible[_T_co], Generic[_T_co]):
def __iter__(self) -> Iterator[_T_co]: ...
def __reversed__(self) -> Iterator[_T_co]: ...
class MutableSequence(Sequence[_T], Generic[_T]):
class MutableSequence(Sequence[_T]):
@abstractmethod
def insert(self, index: int, value: _T) -> None: ...
@overload
@@ -557,7 +557,7 @@ class MutableSequence(Sequence[_T], Generic[_T]):
def remove(self, value: _T) -> None: ...
def __iadd__(self, values: Iterable[_T]) -> typing_extensions.Self: ...
class AbstractSet(Collection[_T_co], Generic[_T_co]):
class AbstractSet(Collection[_T_co]):
@abstractmethod
def __contains__(self, x: object) -> bool: ...
def _hash(self) -> int: ...
@@ -573,7 +573,7 @@ class AbstractSet(Collection[_T_co], Generic[_T_co]):
def __eq__(self, other: object) -> bool: ...
def isdisjoint(self, other: Iterable[Any]) -> bool: ...
class MutableSet(AbstractSet[_T], Generic[_T]):
class MutableSet(AbstractSet[_T]):
@abstractmethod
def add(self, value: _T) -> None: ...
@abstractmethod
@@ -646,7 +646,7 @@ class Mapping(Collection[_KT], Generic[_KT, _VT_co]):
def __contains__(self, __key: object) -> bool: ...
def __eq__(self, __other: object) -> bool: ...
class MutableMapping(Mapping[_KT, _VT], Generic[_KT, _VT]):
class MutableMapping(Mapping[_KT, _VT]):
@abstractmethod
def __setitem__(self, __key: _KT, __value: _VT) -> None: ...
@abstractmethod
@@ -703,7 +703,7 @@ TYPE_CHECKING: bool
# In stubs, the arguments of the IO class are marked as positional-only.
# This differs from runtime, but better reflects the fact that in reality
# classes deriving from IO use different names for the arguments.
class IO(Iterator[AnyStr], Generic[AnyStr]):
class IO(Iterator[AnyStr]):
# At runtime these are all abstract properties,
# but making them abstract in the stub is hugely disruptive, for not much gain.
# See #8726