Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions stdlib/array.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand All @@ -49,20 +49,21 @@ 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: ...
def __delitem__(self, __i: SupportsIndex | slice) -> None: ...
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: ...
Expand Down
1 change: 1 addition & 0 deletions stdlib/tracemalloc.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class Frame:
filename: str
lineno: int
def __init__(self, frame: _FrameTupleT) -> None: ...
def __eq__(self, other: object) -> bool: ...
def __lt__(self, other: Frame) -> bool: ...
if sys.version_info >= (3, 11):
def __gt__(self, other: Frame) -> bool: ...
Expand Down
1 change: 1 addition & 0 deletions stdlib/unittest/mock.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class _Call(tuple[Any, ...]):
def __ne__(self, __other: object) -> bool: ...
def __call__(self, *args: Any, **kwargs: Any) -> _Call: ...
def __getattr__(self, attr: Any) -> Any: ...
def __getattribute__(self, attr: str) -> Any: ...
if sys.version_info >= (3, 8):
@property
def args(self): ...
Expand Down