@@ -353,7 +353,6 @@ from ._typing import (
353
353
DTypeLike ,
354
354
NBitBase ,
355
355
NDArray ,
356
- _ArrayLike ,
357
356
_ArrayLikeDT64_co ,
358
357
_ArrayLikeObject_co ,
359
358
_ArrayLikeTD64_co ,
@@ -2672,79 +2671,59 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeT_co, _DTypeT_co]):
2672
2671
@overload
2673
2672
def __imod__ (self : NDArray [object_ ], x : object , / ) -> ndarray [_ShapeT_co , _DTypeT_co ]: ...
2674
2673
2675
- # TODO(jorenham): rewrite the binops below
2676
-
2677
2674
#
2678
2675
@overload
2679
- def __divmod__ ( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
2680
- self : NDArray [_RealNumberT ],
2681
- rhs : int | bool_ ,
2682
- / ,
2683
- ) -> _2Tuple [_nt .Array [_RealNumberT , _ShapeT_co ]]: ...
2684
- @overload
2685
- def __divmod__ (self : NDArray [_RealNumberT ], rhs : _nt .ToBool_nd , / ) -> _2Tuple [NDArray [_RealNumberT ]]: ... # type: ignore[overload-overlap]
2686
- @overload
2687
- def __divmod__ (self : NDArray [bool_ ], rhs : _ArrayLike [_RealNumberT ], / ) -> _2Tuple [NDArray [_RealNumberT ]]: ...
2688
- @overload
2689
- def __divmod__ (self : NDArray [bool_ ], rhs : _nt .ToBool_nd , / ) -> _2Tuple [NDArray [int8 ]]: ...
2690
- @overload
2691
- def __divmod__ (self : NDArray [float64 ], rhs : _nt .CoFloat64_nd , / ) -> _2Tuple [NDArray [float64 ]]: ...
2692
- @overload
2693
- def __divmod__ (self : _ArrayFloat64_co , rhs : _nt .ToFloat64_nd , / ) -> _2Tuple [NDArray [float64 ]]: ...
2694
- @overload
2695
- def __divmod__ (self : NDArray [unsignedinteger ], rhs : _nt .CoUInt64_nd , / ) -> _2Tuple [NDArray [unsignedinteger ]]: ...
2676
+ def __divmod__ (self : NDArray [bool_ ], x : _nt .ToBool_nd , / ) -> _2Tuple [NDArray [int8 ]]: ...
2696
2677
@overload
2697
- def __divmod__ (self : _ArrayUInt_co , rhs : _nt .ToUInteger_nd , / ) -> _2Tuple [NDArray [unsignedinteger ]]: ...
2678
+ def __divmod__ (self : NDArray [ _RealNumberT ], x : _nt .Casts [ _RealNumberT ] , / ) -> _2Tuple [NDArray [_RealNumberT ]]: ...
2698
2679
@overload
2699
- def __divmod__ (self : NDArray [signedinteger ], rhs : _nt .CoInt64_nd , / ) -> _2Tuple [NDArray [signedinteger ]]: ...
2680
+ def __divmod__ (
2681
+ self : NDArray [_RealT ], x : _nt .CastsWith [_RealT , _RealScalarT ], /
2682
+ ) -> _2Tuple [NDArray [_RealScalarT ]]: ...
2700
2683
@overload
2701
- def __divmod__ (self : _ArrayInt_co , rhs : _nt .ToSInteger_nd , / ) -> _2Tuple [NDArray [signedinteger ]]: ...
2684
+ def __divmod__ (self : NDArray [ _RealNumberT ], x : _nt .SequenceND [ py_bool ] , / ) -> _2Tuple [NDArray [_RealNumberT ]]: ...
2702
2685
@overload
2703
- def __divmod__ (self : NDArray [floating ], rhs : _nt .CoFloating_nd , / ) -> _2Tuple [NDArray [floating ]]: ...
2686
+ def __divmod__ (
2687
+ self : _nt .CastsWithInt [_RealScalarT ], x : _nt .SequenceND [_nt .JustInt ], /
2688
+ ) -> _2Tuple [NDArray [_RealScalarT ]]: ...
2704
2689
@overload
2705
- def __divmod__ (self : NDArray [floating | integer ], rhs : _nt .ToFloating_nd , / ) -> _2Tuple [NDArray [floating ]]: ...
2690
+ def __divmod__ (
2691
+ self : _nt .CastsWithFloat [_RealScalarT ], x : _nt .SequenceND [_nt .JustFloat ], /
2692
+ ) -> _2Tuple [NDArray [_RealScalarT ]]: ...
2706
2693
@overload
2707
2694
def __divmod__ (
2708
- self : NDArray [timedelta64 ],
2709
- rhs : _ArrayLike [timedelta64 ],
2710
- / ,
2695
+ self : NDArray [timedelta64 ], x : _nt .ToTimeDelta_nd , /
2711
2696
) -> tuple [NDArray [int64 ], NDArray [timedelta64 ]]: ...
2712
-
2713
- # keep in sync with __divmod__
2714
2697
@overload
2715
- def __rdivmod__ ( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
2716
- self : NDArray [_RealNumberT ],
2717
- lhs : int | bool_ ,
2718
- / ,
2719
- ) -> _2Tuple [_nt .Array [_RealNumberT , _ShapeT_co ]]: ...
2720
- @overload
2721
- def __rdivmod__ (self : NDArray [_RealNumberT ], lhs : _nt .ToBool_nd , / ) -> _2Tuple [NDArray [_RealNumberT ]]: ... # type: ignore[overload-overlap]
2722
- @overload
2723
- def __rdivmod__ (self : NDArray [bool_ ], lhs : _ArrayLike [_RealNumberT ], / ) -> _2Tuple [NDArray [_RealNumberT ]]: ...
2724
- @overload
2725
- def __rdivmod__ (self : NDArray [bool_ ], lhs : _nt .ToBool_nd , / ) -> _2Tuple [NDArray [int8 ]]: ...
2726
- @overload
2727
- def __rdivmod__ (self : NDArray [float64 ], lhs : _nt .CoFloat64_nd , / ) -> _2Tuple [NDArray [float64 ]]: ...
2728
- @overload
2729
- def __rdivmod__ (self : _ArrayFloat64_co , lhs : _nt .ToFloat64_nd , / ) -> _2Tuple [NDArray [float64 ]]: ...
2698
+ def __divmod__ (self : NDArray [object_ ], x : object , / ) -> _2Tuple [NDArray [object_ ]]: ...
2699
+
2700
+ #
2730
2701
@overload
2731
- def __rdivmod__ (self : NDArray [unsignedinteger ], lhs : _nt .CoUInt64_nd , / ) -> _2Tuple [NDArray [unsignedinteger ]]: ...
2702
+ def __rdivmod__ (self : NDArray [bool_ ], x : _nt .ToBool_nd , / ) -> _2Tuple [NDArray [int8 ]]: ...
2732
2703
@overload
2733
- def __rdivmod__ (self : _ArrayUInt_co , lhs : _nt .ToUInteger_nd , / ) -> _2Tuple [NDArray [unsignedinteger ]]: ...
2704
+ def __rdivmod__ (self : NDArray [ _RealNumberT ], x : _nt .Casts [ _RealNumberT ] , / ) -> _2Tuple [NDArray [_RealNumberT ]]: ...
2734
2705
@overload
2735
- def __rdivmod__ (self : NDArray [signedinteger ], lhs : _nt .CoInt64_nd , / ) -> _2Tuple [NDArray [signedinteger ]]: ...
2706
+ def __rdivmod__ (
2707
+ self : NDArray [_RealT ], x : _nt .CastsWith [_RealT , _RealScalarT ], /
2708
+ ) -> _2Tuple [NDArray [_RealScalarT ]]: ...
2736
2709
@overload
2737
- def __rdivmod__ (self : _ArrayInt_co , lhs : _nt .ToSInteger_nd , / ) -> _2Tuple [NDArray [signedinteger ]]: ...
2710
+ def __rdivmod__ (self : NDArray [ _RealNumberT ], x : _nt .SequenceND [ py_bool ] , / ) -> _2Tuple [NDArray [_RealNumberT ]]: ...
2738
2711
@overload
2739
- def __rdivmod__ (self : NDArray [floating ], lhs : _nt .CoFloating_nd , / ) -> _2Tuple [NDArray [floating ]]: ...
2712
+ def __rdivmod__ (
2713
+ self : _nt .CastsWithInt [_RealScalarT ], x : _nt .SequenceND [_nt .JustInt ], /
2714
+ ) -> _2Tuple [NDArray [_RealScalarT ]]: ...
2740
2715
@overload
2741
- def __rdivmod__ (self : NDArray [floating | integer ], lhs : _nt .ToFloating_nd , / ) -> _2Tuple [NDArray [floating ]]: ...
2716
+ def __rdivmod__ (
2717
+ self : _nt .CastsWithFloat [_RealScalarT ], x : _nt .SequenceND [_nt .JustFloat ], /
2718
+ ) -> _2Tuple [NDArray [_RealScalarT ]]: ...
2742
2719
@overload
2743
2720
def __rdivmod__ (
2744
- self : NDArray [timedelta64 ],
2745
- lhs : _ArrayLike [timedelta64 ],
2746
- / ,
2721
+ self : NDArray [timedelta64 ], x : _nt .ToTimeDelta_nd , /
2747
2722
) -> tuple [NDArray [int64 ], NDArray [timedelta64 ]]: ...
2723
+ @overload
2724
+ def __rdivmod__ (self : NDArray [object_ ], x : object , / ) -> _2Tuple [NDArray [object_ ]]: ...
2725
+
2726
+ # TODO(jorenham): rewrite the binops below
2748
2727
2749
2728
#
2750
2729
@overload
0 commit comments