mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
collections: remove redundant method redefinitions (#6630)
This commit is contained in:
@@ -91,12 +91,10 @@ class UserList(MutableSequence[_T]):
|
||||
def insert(self, i: int, item: _T) -> None: ...
|
||||
def pop(self, i: int = ...) -> _T: ...
|
||||
def remove(self, item: _T) -> None: ...
|
||||
def clear(self) -> None: ...
|
||||
def copy(self: _S) -> _S: ...
|
||||
def count(self, item: _T) -> int: ...
|
||||
# All arguments are passed to `list.index` at runtime, so the signature should be kept in line with `list.index`.
|
||||
def index(self, item: _T, __start: SupportsIndex = ..., __stop: SupportsIndex = ...) -> int: ...
|
||||
def reverse(self) -> None: ...
|
||||
# All arguments are passed to `list.sort` at runtime, so the signature should be kept in line with `list.sort`.
|
||||
@overload
|
||||
def sort(self: UserList[SupportsRichComparisonT], *, key: None = ..., reverse: bool = ...) -> None: ...
|
||||
@@ -190,7 +188,6 @@ class deque(MutableSequence[_T], Generic[_T]):
|
||||
def __init__(self, iterable: Iterable[_T] = ..., maxlen: int | None = ...) -> None: ...
|
||||
def append(self, __x: _T) -> None: ...
|
||||
def appendleft(self, __x: _T) -> None: ...
|
||||
def clear(self) -> None: ...
|
||||
def copy(self: _S) -> _S: ...
|
||||
def count(self, __x: _T) -> int: ...
|
||||
def extend(self, __iterable: Iterable[_T]) -> None: ...
|
||||
@@ -200,11 +197,9 @@ class deque(MutableSequence[_T], Generic[_T]):
|
||||
def pop(self) -> _T: ... # type: ignore[override]
|
||||
def popleft(self) -> _T: ...
|
||||
def remove(self, __value: _T) -> None: ...
|
||||
def reverse(self) -> None: ...
|
||||
def rotate(self, __n: int = ...) -> None: ...
|
||||
def __copy__(self: _S) -> _S: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __iter__(self) -> Iterator[_T]: ...
|
||||
def __str__(self) -> str: ...
|
||||
# These methods of deque don't take slices, unlike MutableSequence, hence the type: ignores
|
||||
def __getitem__(self, __index: SupportsIndex) -> _T: ... # type: ignore[override]
|
||||
@@ -212,7 +207,6 @@ class deque(MutableSequence[_T], Generic[_T]):
|
||||
def __delitem__(self, __i: SupportsIndex) -> None: ... # type: ignore[override]
|
||||
def __contains__(self, __o: object) -> bool: ...
|
||||
def __reduce__(self: Self) -> tuple[Type[Self], tuple[()], None, Iterator[_T]]: ...
|
||||
def __reversed__(self) -> Iterator[_T]: ...
|
||||
def __iadd__(self: _S, __iterable: Iterable[_T]) -> _S: ...
|
||||
def __add__(self: _S, __other: _S) -> _S: ...
|
||||
def __mul__(self: _S, __other: int) -> _S: ...
|
||||
|
||||
Reference in New Issue
Block a user