mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Add missing dunder overrides in array, tracemalloc and unittest.mock (#7248)
This commit is contained in:
@@ -35,7 +35,7 @@ class array(MutableSequence[_T], Generic[_T]):
|
||||
if sys.version_info >= (3, 10):
|
||||
def index(self, __v: _T, __start: int = ..., __stop: int = ...) -> int: ...
|
||||
else:
|
||||
def index(self, __v: _T) -> int: ... # type: ignore # Overrides Sequence
|
||||
def index(self, __v: _T) -> int: ... # type: ignore[override]
|
||||
|
||||
def insert(self, __i: int, __v: _T) -> None: ...
|
||||
def pop(self, __i: int = ...) -> _T: ...
|
||||
@@ -49,12 +49,13 @@ class array(MutableSequence[_T], Generic[_T]):
|
||||
def fromstring(self, __buffer: bytes) -> None: ...
|
||||
def tostring(self) -> bytes: ...
|
||||
|
||||
def __contains__(self, __key: object) -> bool: ...
|
||||
def __len__(self) -> int: ...
|
||||
@overload
|
||||
def __getitem__(self, __i: SupportsIndex) -> _T: ...
|
||||
@overload
|
||||
def __getitem__(self, __s: slice) -> array[_T]: ...
|
||||
@overload # type: ignore # Overrides MutableSequence
|
||||
@overload # type: ignore[override]
|
||||
def __setitem__(self, __i: SupportsIndex, __o: _T) -> None: ...
|
||||
@overload
|
||||
def __setitem__(self, __s: slice, __o: array[_T]) -> None: ...
|
||||
@@ -62,7 +63,7 @@ class array(MutableSequence[_T], Generic[_T]):
|
||||
def __add__(self, __x: array[_T]) -> array[_T]: ...
|
||||
def __ge__(self, __other: array[_T]) -> bool: ...
|
||||
def __gt__(self, __other: array[_T]) -> bool: ...
|
||||
def __iadd__(self: Self, __x: array[_T]) -> Self: ... # type: ignore # Overrides MutableSequence
|
||||
def __iadd__(self: Self, __x: array[_T]) -> Self: ... # type: ignore[override]
|
||||
def __imul__(self: Self, __n: int) -> Self: ...
|
||||
def __le__(self, __other: array[_T]) -> bool: ...
|
||||
def __lt__(self, __other: array[_T]) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user