@@ -104,6 +104,7 @@ from pandas._libs.tslibs.nattype import NaTType
104
104
from pandas ._libs .tslibs .offsets import DateOffset
105
105
from pandas ._typing import (
106
106
S1 ,
107
+ S1C ,
107
108
S2 ,
108
109
AggFuncTypeBase ,
109
110
AggFuncTypeDictFrame ,
@@ -186,29 +187,26 @@ from pandas.core.dtypes.dtypes import CategoricalDtype
186
187
187
188
from pandas .plotting import PlotAccessor
188
189
189
- _T_FLOAT = TypeVar ("_T_FLOAT" , bound = float )
190
190
_T_COMPLEX = TypeVar ("_T_COMPLEX" , bound = complex )
191
191
192
- _scalar_timestamp : TypeAlias = datetime | np .datetime64 | Timestamp
192
+ _scalar_timestamp : TypeAlias = date | datetime | np .datetime64
193
193
_vector_timestamp : TypeAlias = (
194
- Sequence [datetime ]
194
+ Sequence [date ]
195
+ | Sequence [datetime ]
195
196
| Sequence [np .datetime64 ]
196
- | Sequence [Timestamp ]
197
197
| np .typing .NDArray [np .datetime64 ]
198
198
| DatetimeIndex
199
199
)
200
200
_nonseries_timestamp : TypeAlias = _scalar_timestamp | _vector_timestamp
201
201
202
- _scalar_timedelta : TypeAlias = timedelta | np .timedelta64 | BaseOffset | Timedelta
202
+ _scalar_timedelta : TypeAlias = timedelta | np .timedelta64 | BaseOffset
203
203
_vector_timedelta : TypeAlias = (
204
204
Sequence [timedelta ]
205
205
| Sequence [np .timedelta64 ]
206
- | Sequence [Timedelta ]
207
206
| np .typing .NDArray [np .timedelta64 ]
208
207
| TimedeltaIndex
209
208
)
210
209
_nonseries_timedelta : TypeAlias = _scalar_timedelta | _vector_timedelta
211
- _T_TIMESTAMP = TypeVar ("_T_TIMESTAMP" , bound = Timestamp )
212
210
213
211
class _iLocIndexerSeries (_iLocIndexer , Generic [S1 ]):
214
212
# get item
@@ -1634,9 +1632,9 @@ class Series(IndexOpsMixin[S1], NDFrame):
1634
1632
# just failed to generate these so I couldn't match
1635
1633
# them up.
1636
1634
@overload
1637
- def __add__ (self : Series [Never ], other : Scalar | _ListLike | Series ) -> Series : ... # type: ignore[overload-overlap]
1635
+ def __add__ (self : Series [Never ], other : Scalar | _ListLike | Series ) -> Series : ...
1638
1636
@overload
1639
- def __add__ (self , other : Series [Never ]) -> Series : ...
1637
+ def __add__ (self : Series [ S1C ] , other : Series [Never ]) -> Series : ...
1640
1638
@overload
1641
1639
def __add__ (
1642
1640
self : Series [int ], other : _T_COMPLEX | Sequence [_T_COMPLEX ] | Series [_T_COMPLEX ]
@@ -1671,10 +1669,10 @@ class Series(IndexOpsMixin[S1], NDFrame):
1671
1669
| np_ndarray_complex
1672
1670
),
1673
1671
) -> Series [complex ]: ...
1674
- @overload
1675
- def __add__ (
1676
- self : Series [Timestamp ], other : _nonseries_timestamp # | Series[Timestamp]
1677
- ) -> Never : ...
1672
+ # @overload
1673
+ # def __add__(
1674
+ # self: Series[Timestamp], other: _nonseries_timestamp # | Series[Timestamp]
1675
+ # ) -> Never: ...
1678
1676
@overload
1679
1677
def __add__ (
1680
1678
self : Series [Timestamp ],
@@ -1687,7 +1685,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1687
1685
self : Series [Timedelta ], other : _nonseries_timestamp | Series [Timestamp ]
1688
1686
) -> Series [Timestamp ]: ...
1689
1687
@overload
1690
- def __add__ (self , other : S1 | Series [S1 ]) -> Self : ...
1688
+ def __add__ (self : Series [ S1C ] , other : S1C | Series [S1C ]) -> Series [ S1C ] : ...
1691
1689
@overload
1692
1690
def add (
1693
1691
self : Series [Never ],
@@ -1937,7 +1935,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1937
1935
@overload
1938
1936
def __mul__ (self : Series [Never ], other : num | _ListLike | Series ) -> Series : ...
1939
1937
@overload
1940
- def __mul__ (self , other : Series [Never ]) -> Series : ... # type: ignore[overload-overlap]
1938
+ def __mul__ (self : Series [ S1C ] , other : Series [Never ]) -> Series : ... # type: ignore[overload-overlap]
1941
1939
@overload
1942
1940
def __mul__ (
1943
1941
self : Series [int ], other : _T_COMPLEX | Series [_T_COMPLEX ]
@@ -1955,7 +1953,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1955
1953
) -> Never : ...
1956
1954
@overload
1957
1955
def __mul__ (
1958
- self : Series [ _T_FLOAT ] , other : _nonseries_timedelta | TimedeltaSeries
1956
+ self , other : timedelta | Timedelta | TimedeltaSeries | np . timedelta64
1959
1957
) -> TimedeltaSeries : ...
1960
1958
@overload
1961
1959
def __mul__ (self , other : num | _ListLike | Series ) -> Series : ...
@@ -2014,7 +2012,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
2014
2012
) -> Series [Timestamp ]: ...
2015
2013
@overload
2016
2014
def __sub__ (
2017
- self : Series [Timestamp ], other : _nonseries_timestamp | Series [_T_TIMESTAMP ]
2015
+ self : Series [Timestamp ], other : _nonseries_timestamp | Series [Timestamp ]
2018
2016
) -> TimedeltaSeries : ...
2019
2017
@overload
2020
2018
def __sub__ (self , other : S1 | Self ) -> Self : ...
0 commit comments