Backport more Self-related changes to Python 2 (#7166)

This commit is contained in:
Alex Waygood
2022-02-08 17:52:43 +00:00
committed by GitHub
parent 2381066c15
commit 5f830d023f
8 changed files with 29 additions and 32 deletions

View File

@@ -58,7 +58,6 @@ NoReturn = Union[None]
# These type variables are used by the container types.
_T = TypeVar("_T")
_S = TypeVar("_S")
_KT = TypeVar("_KT") # Key type.
_VT = TypeVar("_VT") # Value type.
_T_co = TypeVar("_T_co", covariant=True) # Any type covariant containers.
@@ -211,7 +210,7 @@ class MutableSequence(Sequence[_T], Generic[_T]):
def reverse(self) -> None: ...
def pop(self, index: int = ...) -> _T: ...
def remove(self, object: _T) -> None: ...
def __iadd__(self, x: Iterable[_T]) -> MutableSequence[_T]: ...
def __iadd__(self: Self, x: Iterable[_T]) -> Self: ...
class AbstractSet(Iterable[_T_co], Container[_T_co], Generic[_T_co]):
@abstractmethod
@@ -240,10 +239,10 @@ class MutableSet(AbstractSet[_T], Generic[_T]):
def clear(self) -> None: ...
def pop(self) -> _T: ...
def remove(self, element: _T) -> None: ...
def __ior__(self, s: AbstractSet[_S]) -> MutableSet[_T | _S]: ...
def __iand__(self, s: AbstractSet[Any]) -> MutableSet[_T]: ...
def __ixor__(self, s: AbstractSet[_S]) -> MutableSet[_T | _S]: ...
def __isub__(self, s: AbstractSet[Any]) -> MutableSet[_T]: ...
def __ior__(self: Self, s: AbstractSet[_T]) -> Self: ...
def __iand__(self: Self, s: AbstractSet[Any]) -> Self: ...
def __ixor__(self: Self, s: AbstractSet[_T]) -> Self: ...
def __isub__(self: Self, s: AbstractSet[Any]) -> Self: ...
class MappingView(object):
def __len__(self) -> int: ...