@@ -54,7 +54,11 @@ from pandas.core.arrays.base import ExtensionArray
5454from pandas .core .arrays .categorical import CategoricalAccessor
5555from pandas .core .arrays .datetimes import DatetimeArray
5656from 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+ )
5862from pandas .core .frame import DataFrame
5963from pandas .core .generic import NDFrame
6064from pandas .core .groupby .generic import SeriesGroupBy
@@ -258,20 +262,9 @@ class _LocIndexerSeries(_LocIndexer, Generic[S1]):
258262 value : S1 | ArrayLike | Series [S1 ] | None ,
259263 ) -> None : ...
260264
261- _ListLike : TypeAlias = ArrayLike | dict [_str , np .ndarray ] | SequenceNotStr [S1 ]
262265_ListLikeS1 : TypeAlias = (
263266 ArrayLike | dict [_str , np .ndarray ] | Sequence [S1 ] | IndexOpsMixin [S1 ]
264267)
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- )
275268
276269class Series (IndexOpsMixin [S1 ], NDFrame ):
277270 # 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):
21252118 ) -> Series [_bool ]: ...
21262119 @overload
21272120 def __mul__ (
2128- self : Series [Never ], other : complex | _NumListLike | Series
2121+ self : Series [Never ], other : complex | NumListLike | Series
21292122 ) -> Series : ...
21302123 @overload
21312124 def __mul__ (self , other : Series [Never ]) -> Series : ... # type: ignore[overload-overlap]
@@ -2321,7 +2314,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
23212314 ) -> TimedeltaSeries : ...
23222315 @overload
23232316 def __rmul__ (
2324- self : Series [Never ], other : complex | _NumListLike | Series
2317+ self : Series [Never ], other : complex | NumListLike | Series
23252318 ) -> Series : ...
23262319 @overload
23272320 def __rmul__ (self , other : Series [Never ]) -> Series : ... # type: ignore[overload-overlap]
@@ -2555,7 +2548,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
25552548 ) -> Never : ...
25562549 @overload
25572550 def __sub__ (
2558- self : Series [Never ], other : complex | _NumListLike | Index | Series
2551+ self : Series [Never ], other : complex | NumListLike | Index | Series
25592552 ) -> Series : ...
25602553 @overload
25612554 def __sub__ (self , other : Index [Never ] | Series [Never ]) -> Series : ... # type: ignore[overload-overlap]
@@ -2680,7 +2673,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
26802673 @overload
26812674 def sub (
26822675 self : Series [Never ],
2683- other : complex | _NumListLike | Index | Series ,
2676+ other : complex | NumListLike | Index | Series ,
26842677 level : Level | None = None ,
26852678 fill_value : float | None = None ,
26862679 axis : int = 0 ,
@@ -2834,7 +2827,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
28342827 def __rsub__ (self : Series [Never ], other : DatetimeIndex | TimestampSeries ) -> Never : ... # type: ignore[misc]
28352828 @overload
28362829 def __rsub__ (
2837- self : Series [Never ], other : complex | _NumListLike | Index | Series
2830+ self : Series [Never ], other : complex | NumListLike | Index | Series
28382831 ) -> Series : ...
28392832 @overload
28402833 def __rsub__ (self , other : Index [Never ] | Series [Never ]) -> Series : ...
@@ -2937,7 +2930,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
29372930 @overload
29382931 def rsub (
29392932 self : Series [Never ],
2940- other : complex | _NumListLike | Index | Series ,
2933+ other : complex | NumListLike | Index | Series ,
29412934 level : Level | None = None ,
29422935 fill_value : float | None = None ,
29432936 axis : int = 0 ,
@@ -3061,7 +3054,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
30613054 ) -> Series [complex ]: ...
30623055 @overload
30633056 def __truediv__ ( # type:ignore[overload-overlap]
3064- self : Series [Never ], other : complex | _NumListLike | Series
3057+ self : Series [Never ], other : complex | NumListLike | Series
30653058 ) -> Series : ...
30663059 @overload
30673060 def __truediv__ (self , other : Series [Never ]) -> Series : ...
@@ -3257,7 +3250,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
32573250 div = truediv
32583251 @overload
32593252 def __rtruediv__ ( # type:ignore[overload-overlap]
3260- self : Series [Never ], other : complex | _NumListLike | Series
3253+ self : Series [Never ], other : complex | NumListLike | Series
32613254 ) -> Series : ...
32623255 @overload
32633256 def __rtruediv__ (self , other : Series [Never ]) -> Series : ...
0 commit comments