mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-23 19:41:51 +08:00
Backport more Self-related changes to Python 2 (#7166)
This commit is contained in:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user