Skip to content

Commit 1f6c691

Browse files
authored
Add missing dunder overrides in array, tracemalloc and unittest.mock (#7248)
1 parent 5c309e5 commit 1f6c691

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

stdlib/array.pyi

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class array(MutableSequence[_T], Generic[_T]):
3535
if sys.version_info >= (3, 10):
3636
def index(self, __v: _T, __start: int = ..., __stop: int = ...) -> int: ...
3737
else:
38-
def index(self, __v: _T) -> int: ... # type: ignore # Overrides Sequence
38+
def index(self, __v: _T) -> int: ... # type: ignore[override]
3939

4040
def insert(self, __i: int, __v: _T) -> None: ...
4141
def pop(self, __i: int = ...) -> _T: ...
@@ -49,20 +49,21 @@ class array(MutableSequence[_T], Generic[_T]):
4949
def fromstring(self, __buffer: bytes) -> None: ...
5050
def tostring(self) -> bytes: ...
5151

52+
def __contains__(self, __key: object) -> bool: ...
5253
def __len__(self) -> int: ...
5354
@overload
5455
def __getitem__(self, __i: SupportsIndex) -> _T: ...
5556
@overload
5657
def __getitem__(self, __s: slice) -> array[_T]: ...
57-
@overload # type: ignore # Overrides MutableSequence
58+
@overload # type: ignore[override]
5859
def __setitem__(self, __i: SupportsIndex, __o: _T) -> None: ...
5960
@overload
6061
def __setitem__(self, __s: slice, __o: array[_T]) -> None: ...
6162
def __delitem__(self, __i: SupportsIndex | slice) -> None: ...
6263
def __add__(self, __x: array[_T]) -> array[_T]: ...
6364
def __ge__(self, __other: array[_T]) -> bool: ...
6465
def __gt__(self, __other: array[_T]) -> bool: ...
65-
def __iadd__(self: Self, __x: array[_T]) -> Self: ... # type: ignore # Overrides MutableSequence
66+
def __iadd__(self: Self, __x: array[_T]) -> Self: ... # type: ignore[override]
6667
def __imul__(self: Self, __n: int) -> Self: ...
6768
def __le__(self, __other: array[_T]) -> bool: ...
6869
def __lt__(self, __other: array[_T]) -> bool: ...

stdlib/tracemalloc.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class Frame:
4343
filename: str
4444
lineno: int
4545
def __init__(self, frame: _FrameTupleT) -> None: ...
46+
def __eq__(self, other: object) -> bool: ...
4647
def __lt__(self, other: Frame) -> bool: ...
4748
if sys.version_info >= (3, 11):
4849
def __gt__(self, other: Frame) -> bool: ...

stdlib/unittest/mock.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ class _Call(tuple[Any, ...]):
9494
def __ne__(self, __other: object) -> bool: ...
9595
def __call__(self, *args: Any, **kwargs: Any) -> _Call: ...
9696
def __getattr__(self, attr: Any) -> Any: ...
97+
def __getattribute__(self, attr: str) -> Any: ...
9798
if sys.version_info >= (3, 8):
9899
@property
99100
def args(self): ...

0 commit comments

Comments
 (0)