@@ -54,7 +54,11 @@ from pandas.core.arrays.base import ExtensionArray
54
54
from pandas .core .arrays .categorical import CategoricalAccessor
55
55
from pandas .core .arrays .datetimes import DatetimeArray
56
56
from pandas .core .arrays .interval import IntervalArray
57
- from pandas .core .base import IndexOpsMixin
57
+ from pandas .core .base import (
58
+ IndexOpsMixin ,
59
+ NumListLike ,
60
+ _ListLike ,
61
+ )
58
62
from pandas .core .frame import DataFrame
59
63
from pandas .core .generic import NDFrame
60
64
from pandas .core .groupby .generic import SeriesGroupBy
@@ -258,20 +262,9 @@ class _LocIndexerSeries(_LocIndexer, Generic[S1]):
258
262
value : S1 | ArrayLike | Series [S1 ] | None ,
259
263
) -> None : ...
260
264
261
- _ListLike : TypeAlias = ArrayLike | dict [_str , np .ndarray ] | SequenceNotStr [S1 ]
262
265
_ListLikeS1 : TypeAlias = (
263
266
ArrayLike | dict [_str , np .ndarray ] | Sequence [S1 ] | IndexOpsMixin [S1 ]
264
267
)
265
- _NumListLike : TypeAlias = (
266
- ExtensionArray
267
- | np_ndarray_bool
268
- | np_ndarray_anyint
269
- | np_ndarray_float
270
- | np_ndarray_complex
271
- | dict [_str , np .ndarray ]
272
- | Sequence [complex ]
273
- | IndexOpsMixin [complex ]
274
- )
275
268
276
269
class Series (IndexOpsMixin [S1 ], NDFrame ):
277
270
# Define __index__ because mypy thinks Series follows protocol `SupportsIndex` https://github.com/pandas-dev/pandas-stubs/pull/1332#discussion_r2285648790
@@ -2125,7 +2118,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
2125
2118
) -> Series [_bool ]: ...
2126
2119
@overload
2127
2120
def __mul__ (
2128
- self : Series [Never ], other : complex | _NumListLike | Series
2121
+ self : Series [Never ], other : complex | NumListLike | Series
2129
2122
) -> Series : ...
2130
2123
@overload
2131
2124
def __mul__ (self , other : Series [Never ]) -> Series : ... # type: ignore[overload-overlap]
@@ -2321,7 +2314,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
2321
2314
) -> TimedeltaSeries : ...
2322
2315
@overload
2323
2316
def __rmul__ (
2324
- self : Series [Never ], other : complex | _NumListLike | Series
2317
+ self : Series [Never ], other : complex | NumListLike | Series
2325
2318
) -> Series : ...
2326
2319
@overload
2327
2320
def __rmul__ (self , other : Series [Never ]) -> Series : ... # type: ignore[overload-overlap]
@@ -2555,7 +2548,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
2555
2548
) -> Never : ...
2556
2549
@overload
2557
2550
def __sub__ (
2558
- self : Series [Never ], other : complex | _NumListLike | Index | Series
2551
+ self : Series [Never ], other : complex | NumListLike | Index | Series
2559
2552
) -> Series : ...
2560
2553
@overload
2561
2554
def __sub__ (self , other : Index [Never ] | Series [Never ]) -> Series : ... # type: ignore[overload-overlap]
@@ -2680,7 +2673,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
2680
2673
@overload
2681
2674
def sub (
2682
2675
self : Series [Never ],
2683
- other : complex | _NumListLike | Index | Series ,
2676
+ other : complex | NumListLike | Index | Series ,
2684
2677
level : Level | None = None ,
2685
2678
fill_value : float | None = None ,
2686
2679
axis : int = 0 ,
@@ -2834,7 +2827,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
2834
2827
def __rsub__ (self : Series [Never ], other : DatetimeIndex | TimestampSeries ) -> Never : ... # type: ignore[misc]
2835
2828
@overload
2836
2829
def __rsub__ (
2837
- self : Series [Never ], other : complex | _NumListLike | Index | Series
2830
+ self : Series [Never ], other : complex | NumListLike | Index | Series
2838
2831
) -> Series : ...
2839
2832
@overload
2840
2833
def __rsub__ (self , other : Index [Never ] | Series [Never ]) -> Series : ...
@@ -2937,7 +2930,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
2937
2930
@overload
2938
2931
def rsub (
2939
2932
self : Series [Never ],
2940
- other : complex | _NumListLike | Index | Series ,
2933
+ other : complex | NumListLike | Index | Series ,
2941
2934
level : Level | None = None ,
2942
2935
fill_value : float | None = None ,
2943
2936
axis : int = 0 ,
@@ -3061,7 +3054,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
3061
3054
) -> Series [complex ]: ...
3062
3055
@overload
3063
3056
def __truediv__ ( # type:ignore[overload-overlap]
3064
- self : Series [Never ], other : complex | _NumListLike | Series
3057
+ self : Series [Never ], other : complex | NumListLike | Series
3065
3058
) -> Series : ...
3066
3059
@overload
3067
3060
def __truediv__ (self , other : Series [Never ]) -> Series : ...
@@ -3257,7 +3250,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
3257
3250
div = truediv
3258
3251
@overload
3259
3252
def __rtruediv__ ( # type:ignore[overload-overlap]
3260
- self : Series [Never ], other : complex | _NumListLike | Series
3253
+ self : Series [Never ], other : complex | NumListLike | Series
3261
3254
) -> Series : ...
3262
3255
@overload
3263
3256
def __rtruediv__ (self , other : Series [Never ]) -> Series : ...
0 commit comments