GeezerVison is showing github.com — TYP: Type ``MaskedArray.__{add,radd,sub,rsub}__`` by MarcoGorelli · Pull Request #29012 · numpy/numpy
TYP: Type MaskedArray.__{add,radd,sub,rsub}__
#29012
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
Uh oh!
There was an error while loading. Please reload this page.
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9bc7b74
TYP: Type ``MaskedArray.__{add,radd,sub,rsub}__``
MarcoGorelli May 20, 2025
02fbee2
Merge remote-tracking branch 'upstream/main' into ma-arithmetic
MarcoGorelli May 20, 2025
5889f5c
"in-sync" comment in test, copy comment in __radd__, use _AnyShape
MarcoGorelli May 20, 2025
d605c2f
noop
MarcoGorelli May 21, 2025
dd7293b
Merge remote-tracking branch 'upstream/main' into ma-arithmetic
MarcoGorelli May 22, 2025
93edb06
Merge remote-tracking branch 'upstream/main' into ma-arithmetic
MarcoGorelli May 27, 2025
3158d6a
keep in sync comments
MarcoGorelli May 28, 2025
c8bceae
Merge remote-tracking branch 'upstream/main' into ma-arithmetic
MarcoGorelli May 28, 2025
File filter
Filter by extension
.pyi
(2)
All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Hide whitespace
Diff view
Hide whitespace
"in-sync" comment in test, copy comment in __radd__, use _AnyShape
Loading branch information
Uh oh!
There was an error while loading. Please reload this page.
commit 5889f5c8ea40db29b5b62bc68e8f766049bc5b7d
There are no files selected for viewing
Original file line number
Diff line number
Diff line change
Expand Up
@@ -529,14 +529,14 @@ class MaskedArray(ndarray[_ShapeT_co, _DTypeT_co]):
self: MaskedArray[Any, dtypes.StringDType],
other: _ArrayLikeStr_co | _ArrayLikeString_co,
/,
) -> MaskedArray[tuple[Any, ...] , dtypes.StringDType]: ...
) -> MaskedArray[_AnyShape , dtypes.StringDType]: ...
@overload
def __add__(self: _MaskedArray[object_], other: Any, /) -> Any: ...
@overload
def __add__(self: _MaskedArray[Any], other: _ArrayLikeObject_co, /) -> Any: ...
# Keep in sync with `ndarray.__radd__`
@overload
@overload # signature equivalent to __add__
def __radd__(self: _MaskedArray[_NumberT], other: int | np.bool, /) -> MaskedArray[_ShapeT_co, dtype[_NumberT]]: ...
@overload
def __radd__(self: _MaskedArray[_NumberT], other: _ArrayLikeBool_co, /) -> _MaskedArray[_NumberT]: ... # type: ignore[overload-overlap]
Expand Down
Expand Up
@@ -577,7 +577,7 @@ class MaskedArray(ndarray[_ShapeT_co, _DTypeT_co]):
self: MaskedArray[Any, dtypes.StringDType],
other: _ArrayLikeStr_co | _ArrayLikeString_co,
/,
) -> MaskedArray[tuple[Any, ...] , dtypes.StringDType]: ...
) -> MaskedArray[_AnyShape , dtypes.StringDType]: ...
@overload
def __radd__(self: _MaskedArray[object_], other: Any, /) -> Any: ...
@overload
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -502,6 +502,7 @@ assert_type(AR_LIKE_dt64 + MAR_o, Any)
assert_type(AR_LIKE_o + MAR_o, Any)
# Masked Array subtraction
# Keep in sync with numpy/typing/tests/data/reveal/arithmetic.pyi
assert_type(MAR_number - AR_number, MaskedArray[np.number])
Expand Down
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.