@@ -1961,8 +1961,6 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeT_co, _DTypeT_co]):
1961
1961
@overload
1962
1962
def __add__ (self : NDArray [_ScalarT ], x : _nt .CanCastND [Any , _ScalarT ], / ) -> NDArray [_ScalarT ]: ... # type: ignore[overload-overlap]
1963
1963
@overload
1964
- def __add__ (self : NDArray [_ScalarT ], x : _nt .CanCastND [Any , Any , _ScalarT , _ScalarT2 ], / ) -> NDArray [_ScalarT2 ]: ... # type: ignore[overload-overlap]
1965
- @overload
1966
1964
def __add__ (self : NDArray [_ScalarT ], x : _nt .MatchND [Any , _nt .PromoteWith [_ScalarT , _ScalarT2 ]], / ) -> NDArray [_ScalarT2 ]: ... # type: ignore[overload-overlap]
1967
1965
@overload
1968
1966
def __add__ (self : NDArray [generic [_AnyItemT ]], x : _nt .SequenceND [_AnyItemT ], / ) -> ndarray [tuple [int , ...], _DTypeT_co ]: ...
@@ -1981,8 +1979,6 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeT_co, _DTypeT_co]):
1981
1979
@overload
1982
1980
def __radd__ (self : NDArray [_ScalarT ], x : _nt .CanCastND [Any , _ScalarT ], / ) -> NDArray [_ScalarT ]: ... # type: ignore[overload-overlap]
1983
1981
@overload
1984
- def __radd__ (self : NDArray [_ScalarT ], x : _nt .CanCastND [Any , Any , _ScalarT , _ScalarT2 ], / ) -> NDArray [_ScalarT2 ]: ... # type: ignore[overload-overlap]
1985
- @overload
1986
1982
def __radd__ (self : NDArray [_ScalarT ], x : _nt .MatchND [Any , _nt .PromoteWith [_ScalarT , _ScalarT2 ]], / ) -> NDArray [_ScalarT2 ]: ... # type: ignore[overload-overlap]
1987
1983
@overload
1988
1984
def __radd__ (self : NDArray [generic [_AnyItemT ]], x : _nt .SequenceND [_AnyItemT ], / ) -> ndarray [tuple [int , ...], _DTypeT_co ]: ...
@@ -4043,6 +4039,9 @@ class integer(_IntegralMixin, _RoundMixin, number[_BitT, int]):
4043
4039
above : bool_ ,
4044
4040
/ ,
4045
4041
) -> integer : ...
4042
+ @type_check_only
4043
+ def __nep50_rule4__ (self , other : _JustSignedInteger , / ) -> signedinteger | float64 : ...
4044
+ @type_check_only
4046
4045
def __nep50_rule5__ (self , other : _nt .Just [integer ], / ) -> integer | float64 : ...
4047
4046
4048
4047
#
@@ -4056,35 +4055,23 @@ class integer(_IntegralMixin, _RoundMixin, number[_BitT, int]):
4056
4055
4057
4056
#
4058
4057
@overload
4059
- def __add__ (self , x : int , / ) -> Self : ...
4058
+ def __add__ (self , x : _nt . CanCast0D [ Self ] | int , / ) -> Self : ...
4060
4059
@overload
4061
4060
def __add__ (self , x : _nt .JustFloat , / ) -> float64 : ...
4062
4061
@overload
4063
4062
def __add__ (self , x : _nt .JustComplex , / ) -> complex128 : ...
4064
4063
@overload
4065
- def __add__ (self , x : _nt .CanCast0D [Self ], / ) -> Self : ...
4066
- @overload
4067
- def __add__ (self , x : _nt .CanCast0D [Any , Self , _ScalarT ], / ) -> _ScalarT : ...
4068
- @overload
4069
- def __add__ (self , x : _nt .PromoteWith0D [Self , _ScalarT ], / ) -> _ScalarT : ...
4070
- @overload
4071
- def __add__ (self : _nt .PromoteWith [_ScalarT , _ScalarT2 ], x : _nt .CanArray0D [_ScalarT ], / ) -> _ScalarT2 : ... # pyright: ignore[reportIncompatibleMethodOverride]
4064
+ def __add__ (self , x : _nt .PromoteWith0D [Self , _ScalarT ], / ) -> _ScalarT : ... # pyright: ignore[reportIncompatibleMethodOverride]
4072
4065
4073
4066
#
4074
4067
@overload
4075
- def __radd__ (self , x : int , / ) -> Self : ...
4068
+ def __radd__ (self , x : _nt . CanCast0D [ Self ] | int , / ) -> Self : ...
4076
4069
@overload
4077
4070
def __radd__ (self , x : _nt .JustFloat , / ) -> float64 : ...
4078
4071
@overload
4079
4072
def __radd__ (self , x : _nt .JustComplex , / ) -> complex128 : ...
4080
4073
@overload
4081
- def __radd__ (self , x : _nt .CanCast0D [Self ], / ) -> Self : ...
4082
- @overload
4083
- def __radd__ (self , x : _nt .CanCast0D [Any , Self , _ScalarT ], / ) -> _ScalarT : ...
4084
- @overload
4085
- def __radd__ (self , x : _nt .PromoteWith0D [Self , _ScalarT ], / ) -> _ScalarT : ...
4086
- @overload
4087
- def __radd__ (self : _nt .PromoteWith [_ScalarT , _ScalarT2 ], x : _nt .CanArray0D [_ScalarT ], / ) -> _ScalarT2 : ... # pyright: ignore[reportIncompatibleMethodOverride]
4074
+ def __radd__ (self , x : _nt .PromoteWith0D [Self , _ScalarT ], / ) -> _ScalarT : ... # pyright: ignore[reportIncompatibleMethodOverride]
4088
4075
4089
4076
# keep in sync with __add__
4090
4077
@overload
@@ -4250,10 +4237,11 @@ class signedinteger(integer[_BitT]):
4250
4237
/ ,
4251
4238
) -> signedinteger : ...
4252
4239
@type_check_only
4253
- def __nep50_rule0__ (self , other : uint32 , / ) -> int64 : ...
4240
+ def __nep50_rule0__ (self , other : uint32 | int64 , / ) -> int64 : ...
4254
4241
@type_check_only
4255
4242
def __nep50_rule1__ (self , other : uint64 , / ) -> float64 : ...
4256
4243
@type_check_only
4244
+ @override
4257
4245
def __nep50_rule4__ (self , other : _JustSignedInteger , / ) -> signedinteger : ...
4258
4246
@type_check_only
4259
4247
@override
@@ -4453,8 +4441,6 @@ class unsignedinteger(integer[_BitT]):
4453
4441
) -> unsignedinteger : ...
4454
4442
@type_check_only
4455
4443
def __nep50_rule3__ (self , other : _JustUnsignedInteger , / ) -> unsignedinteger : ...
4456
- @type_check_only
4457
- def __nep50_rule4__ (self , other : _JustSignedInteger , / ) -> signedinteger | float64 : ...
4458
4444
4459
4445
#
4460
4446
@property
@@ -7042,7 +7028,7 @@ class int64(_IntROpMixin[int64], signedinteger[_n._64]): # type: ignore[misc]
7042
7028
def __nep50__ (
7043
7029
self ,
7044
7030
below : int64 | float64 | complex128 | longdouble | clongdouble | timedelta64 ,
7045
- above : signedinteger | uint32 | uint16 | uint8 | bool_ ,
7031
+ above : int32 | uint32 | int16 | uint16 | int8 | uint8 | bool_ ,
7046
7032
/ ,
7047
7033
) -> int64 : ...
7048
7034
@type_check_only
@@ -7052,7 +7038,7 @@ class int64(_IntROpMixin[int64], signedinteger[_n._64]): # type: ignore[misc]
7052
7038
def __nep50_rule2__ (self , other : complex64 , / ) -> complex128 : ...
7053
7039
@type_check_only
7054
7040
@override
7055
- def __nep50_rule4__ (self , other : _JustSignedInteger , / ) -> Self : ...
7041
+ def __nep50_rule4__ (self , other : _JustSignedInteger | signedinteger , / ) -> Self : ...
7056
7042
@type_check_only
7057
7043
@override
7058
7044
def __nep50_rule5__ (self , other : _nt .Just [integer ] | _JustUnsignedInteger , / ) -> Self | float64 : ...
0 commit comments