@@ -76,6 +76,7 @@ from pandas.core.window.rolling import (
76
76
)
77
77
from typing_extensions import (
78
78
Never ,
79
+ Self ,
79
80
TypeAlias ,
80
81
)
81
82
import xarray as xr
@@ -302,16 +303,21 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]):
302
303
name : Hashable | None = ...,
303
304
copy : bool = ...,
304
305
fastpath : bool = ...,
305
- ) -> Series [ S1 ] : ...
306
+ ) -> Self : ...
306
307
@overload
307
308
def __new__ (
308
309
cls ,
309
- data : object
310
- | _ListLike
311
- | Series [S1 ]
312
- | dict [int , S1 ]
313
- | dict [_str , S1 ]
314
- | None = ...,
310
+ data : Series [S1 ] | dict [int , S1 ] | dict [_str , S1 ] = ...,
311
+ index : Axes | None = ...,
312
+ dtype = ...,
313
+ name : Hashable | None = ...,
314
+ copy : bool = ...,
315
+ fastpath : bool = ...,
316
+ ) -> Self : ...
317
+ @overload
318
+ def __new__ (
319
+ cls ,
320
+ data : object | _ListLike | None = ...,
315
321
index : Axes | None = ...,
316
322
dtype = ...,
317
323
name : Hashable | None = ...,
@@ -1923,7 +1929,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]):
1923
1929
# ignore needed because of mypy, for using `Never` as type-var.
1924
1930
@overload
1925
1931
def sum (
1926
- self : Series [Never ], # type: ignore[type-var]
1932
+ self : Series [Never ],
1927
1933
axis : AxisIndex | None = ...,
1928
1934
skipna : _bool | None = ...,
1929
1935
level : None = ...,
@@ -2008,16 +2014,16 @@ class TimestampSeries(Series[Timestamp]):
2008
2014
# ignore needed because of mypy
2009
2015
@property
2010
2016
def dt (self ) -> TimestampProperties : ... # type: ignore[override]
2011
- def __add__ (self , other : TimedeltaSeries | np .timedelta64 ) -> TimestampSeries : ... # type: ignore[override]
2012
- def __radd__ (self , other : TimedeltaSeries | np .timedelta64 ) -> TimestampSeries : ... # type: ignore[override]
2017
+ def __add__ (self , other : TimedeltaSeries | np .timedelta64 | timedelta ) -> TimestampSeries : ... # type: ignore[override]
2018
+ def __radd__ (self , other : TimedeltaSeries | np .timedelta64 | timedelta ) -> TimestampSeries : ... # type: ignore[override]
2013
2019
@overload # type: ignore[override]
2014
2020
def __sub__ (
2015
2021
self , other : Timestamp | datetime | TimestampSeries
2016
2022
) -> TimedeltaSeries : ...
2017
2023
@overload
2018
2024
def __sub__ (
2019
2025
self ,
2020
- other : Timedelta | TimedeltaSeries | TimedeltaIndex | np .timedelta64 ,
2026
+ other : timedelta | TimedeltaSeries | TimedeltaIndex | np .timedelta64 ,
2021
2027
) -> TimestampSeries : ...
2022
2028
def __mul__ (self , other : float | Series [int ] | Series [float ] | Sequence [float ]) -> TimestampSeries : ... # type: ignore[override]
2023
2029
def __truediv__ (self , other : float | Series [int ] | Series [float ] | Sequence [float ]) -> TimestampSeries : ... # type: ignore[override]
0 commit comments