@@ -552,7 +552,6 @@ _AnyShapeT = TypeVar(
552
552
tuple [int , int , int , int , int , int , int , int ], # 8-d
553
553
tuple [int , ...], # N-d
554
554
)
555
- _AnyNBitInexact = TypeVar ("_AnyNBitInexact" , _16Bit , _32Bit , _64Bit , _NBitLongDouble )
556
555
_AnyTD64Item = TypeVar ("_AnyTD64Item" , dt .timedelta , int , None , dt .timedelta | int | None )
557
556
_AnyDT64Arg = TypeVar ("_AnyDT64Arg" , dt .datetime , dt .date , None )
558
557
_AnyDate = TypeVar ("_AnyDate" , dt .date , dt .datetime )
@@ -2136,12 +2135,19 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeT_co, _DTypeT_co]):
2136
2135
@overload # ?-d
2137
2136
def __iter__ (self , / ) -> Iterator [Any ]: ...
2138
2137
2139
- # The last overload is for catching recursive objects whose
2140
- # nesting is too deep.
2141
- # The first overload is for catching `bytes` (as they are a subtype of
2142
- # `Sequence[int]`) and `str`. As `str` is a recursive sequence of
2143
- # strings, it will pass through the final overload otherwise
2138
+ #
2139
+ @overload # type: ignore[override]
2140
+ def __eq__ (self , other : _ScalarLike_co | ndarray [_ShapeT_co , dtype [Any ]], / ) -> ndarray [_ShapeT_co , dtype [bool_ ]]: ...
2141
+ @overload
2142
+ def __eq__ (self , other : object , / ) -> NDArray [bool_ ]: ... # pyright: ignore[reportIncompatibleMethodOverride]
2143
+
2144
+ #
2145
+ @overload # type: ignore[override]
2146
+ def __ne__ (self , other : _ScalarLike_co | ndarray [_ShapeT_co , dtype [Any ]], / ) -> ndarray [_ShapeT_co , dtype [bool_ ]]: ...
2147
+ @overload
2148
+ def __ne__ (self , other : object , / ) -> NDArray [bool_ ]: ... # pyright: ignore[reportIncompatibleMethodOverride]
2144
2149
2150
+ #
2145
2151
@overload
2146
2152
def __lt__ (self : _ArrayComplex_co , other : _ArrayLikeNumber_co , / ) -> NDArray [bool_ ]: ...
2147
2153
@overload
@@ -2192,10 +2198,7 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeT_co, _DTypeT_co]):
2192
2198
# Unary ops
2193
2199
2194
2200
@overload
2195
- def __abs__ (
2196
- self : ndarray [_ShapeT , dtype [complexfloating [_AnyNBitInexact ]]],
2197
- / ,
2198
- ) -> ndarray [_ShapeT , dtype [floating [_AnyNBitInexact ]]]: ...
2201
+ def __abs__ (self : ndarray [_ShapeT , dtype [complexfloating [_NBitT ]]], / ) -> ndarray [_ShapeT , dtype [floating [_NBitT ]]]: ...
2199
2202
@overload
2200
2203
def __abs__ (self : _RealArrayT , / ) -> _RealArrayT : ...
2201
2204
@@ -3861,6 +3864,26 @@ class generic(_ArrayOrScalarCommon, Generic[_ItemT_co]):
3861
3864
@abc .abstractmethod
3862
3865
def __init__ (self , / , * args : Any , ** kwargs : Any ) -> None : ...
3863
3866
3867
+ #
3868
+ @overload
3869
+ def __eq__ (self , other : _ScalarLike_co , / ) -> bool_ : ...
3870
+ @overload
3871
+ def __eq__ (self , other : ndarray [_ShapeT , dtype [Any ]], / ) -> ndarray [_ShapeT , dtype [bool_ ]]: ...
3872
+ @overload
3873
+ def __eq__ (self , other : _NestedSequence [ArrayLike ], / ) -> NDArray [bool_ ]: ...
3874
+ @overload
3875
+ def __eq__ (self , other : object , / ) -> Any : ...
3876
+
3877
+ #
3878
+ @overload
3879
+ def __ne__ (self , other : _ScalarLike_co , / ) -> bool_ : ...
3880
+ @overload
3881
+ def __ne__ (self , other : ndarray [_ShapeT , dtype [Any ]], / ) -> ndarray [_ShapeT , dtype [bool_ ]]: ...
3882
+ @overload
3883
+ def __ne__ (self , other : _NestedSequence [ArrayLike ], / ) -> NDArray [bool_ ]: ...
3884
+ @overload
3885
+ def __ne__ (self , other : object , / ) -> Any : ...
3886
+
3864
3887
#
3865
3888
@overload
3866
3889
def __array__ (self , dtype : None = None , / ) -> ndarray [tuple [()], dtype [Self ]]: ...
0 commit comments