-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
base: main
Are you sure you want to change the base?
Conversation
def __sub__(self, other): ... | ||
def __rsub__(self, other): ... | ||
|
||
# Keep in sync with `ndarray.__add__` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it might also be a good idea to mirror these comments on ndarray
side in __init__.pyi
then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would you mind adding those there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure what I'm missing sorry 😄
in ndarray.__add__
, I don't see comments:
Lines 2811 to 2857 in 4125f0a
@overload | |
def __add__(self: NDArray[_NumberT], other: _ArrayLikeBool_co, /) -> NDArray[_NumberT]: ... # type: ignore[overload-overlap] | |
@overload | |
def __add__(self: NDArray[np.bool], other: _ArrayLikeBool_co, /) -> NDArray[np.bool]: ... # type: ignore[overload-overlap] | |
@overload | |
def __add__(self: NDArray[np.bool], other: _ArrayLike[_NumberT], /) -> NDArray[_NumberT]: ... # type: ignore[overload-overlap] | |
@overload | |
def __add__(self: NDArray[float64], other: _ArrayLikeFloat64_co, /) -> NDArray[float64]: ... | |
@overload | |
def __add__(self: _ArrayFloat64_co, other: _ArrayLike[floating[_64Bit]], /) -> NDArray[float64]: ... | |
@overload | |
def __add__(self: NDArray[complex128], other: _ArrayLikeComplex128_co, /) -> NDArray[complex128]: ... | |
@overload | |
def __add__(self: _ArrayComplex128_co, other: _ArrayLike[complexfloating[_64Bit]], /) -> NDArray[complex128]: ... | |
@overload | |
def __add__(self: _ArrayUInt_co, other: _ArrayLikeUInt_co, /) -> NDArray[unsignedinteger]: ... # type: ignore[overload-overlap] | |
@overload | |
def __add__(self: _ArrayInt_co, other: _ArrayLikeInt_co, /) -> NDArray[signedinteger]: ... # type: ignore[overload-overlap] | |
@overload | |
def __add__(self: _ArrayFloat_co, other: _ArrayLikeFloat_co, /) -> NDArray[floating]: ... # type: ignore[overload-overlap] | |
@overload | |
def __add__(self: _ArrayComplex_co, other: _ArrayLikeComplex_co, /) -> NDArray[complexfloating]: ... # type: ignore[overload-overlap] | |
@overload | |
def __add__(self: NDArray[number], other: _ArrayLikeNumber_co, /) -> NDArray[number]: ... # type: ignore[overload-overlap] | |
@overload | |
def __add__(self: _ArrayTD64_co, other: _ArrayLikeTD64_co, /) -> NDArray[timedelta64]: ... | |
@overload | |
def __add__(self: _ArrayTD64_co, other: _ArrayLikeDT64_co, /) -> NDArray[datetime64]: ... | |
@overload | |
def __add__(self: NDArray[datetime64], other: _ArrayLikeTD64_co, /) -> NDArray[datetime64]: ... | |
@overload | |
def __add__(self: NDArray[bytes_], other: _ArrayLikeBytes_co, /) -> NDArray[bytes_]: ... | |
@overload | |
def __add__(self: NDArray[str_], other: _ArrayLikeStr_co, /) -> NDArray[str_]: ... | |
@overload | |
def __add__( | |
self: ndarray[Any, dtypes.StringDType], | |
other: _ArrayLikeStr_co | _ArrayLikeString_co, | |
/, | |
) -> ndarray[tuple[Any, ...], dtypes.StringDType]: ... | |
@overload | |
def __add__(self: NDArray[object_], other: Any, /) -> Any: ... | |
@overload | |
def __add__(self: NDArray[Any], other: _ArrayLikeObject_co, /) -> Any: ... | |
@overload # signature equivalent to __add__ | |
def __radd__(self: NDArray[_NumberT], other: int | np.bool, /) -> ndarray[_ShapeT_co, dtype[_NumberT]]: ... |
in ndarray.__radd__
, there's a single comment, which I've mirrored:
Line 2856 in 4125f0a
@overload # signature equivalent to __add__ |
and in ndarray.__sub__
and ndarray.__rsub__
i don't see comments
No description provided.