FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add missing dunder overrides in `array`, `tracemalloc` and `unittest.mock` by AlexWaygood · Pull Request #7248 · python/typeshed · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .pyi  (3) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
7 changes: 4 additions & 3 deletions stdlib/array.pyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Back | FazBrowse Home | New Git URL