mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Remove incorrect deque method overloads (#6628)
As the current comment in the source code states, these methods don't really take slices. It's surely better just to add `# type: ignore` comments, rather than have an incorrect stub.
This commit is contained in:
@@ -206,20 +206,10 @@ class deque(MutableSequence[_T], Generic[_T]):
|
||||
def __len__(self) -> int: ...
|
||||
def __iter__(self) -> Iterator[_T]: ...
|
||||
def __str__(self) -> str: ...
|
||||
# These methods of deque don't really take slices, but we need to
|
||||
# define them as taking a slice to satisfy MutableSequence.
|
||||
@overload
|
||||
def __getitem__(self, __index: SupportsIndex) -> _T: ...
|
||||
@overload
|
||||
def __getitem__(self, __s: slice) -> MutableSequence[_T]: ...
|
||||
@overload
|
||||
def __setitem__(self, __i: SupportsIndex, __x: _T) -> None: ...
|
||||
@overload
|
||||
def __setitem__(self, __s: slice, __o: Iterable[_T]) -> None: ...
|
||||
@overload
|
||||
def __delitem__(self, __i: SupportsIndex) -> None: ...
|
||||
@overload
|
||||
def __delitem__(self, __s: slice) -> None: ...
|
||||
# These methods of deque don't take slices, unlike MutableSequence, hence the type: ignores
|
||||
def __getitem__(self, __index: SupportsIndex) -> _T: ... # type: ignore[override]
|
||||
def __setitem__(self, __i: SupportsIndex, __x: _T) -> None: ... # type: ignore[override]
|
||||
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]: ...
|
||||
|
||||
Reference in New Issue
Block a user