Add missing dunder overrides in array, tracemalloc and unittest.mock (#7248)

This commit is contained in:
Alex Waygood
2022-02-17 12:22:33 +00:00
committed by GitHub
parent 5c309e5fe4
commit 1f6c691322
3 changed files with 6 additions and 3 deletions

View File

@@ -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: ...