@@ -76,6 +76,7 @@ from pandas.core.window.rolling import (
7676)
7777from typing_extensions import (
7878 Never ,
79+ Self ,
7980 TypeAlias ,
8081)
8182import xarray as xr
@@ -302,16 +303,21 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]):
302303 name : Hashable | None = ...,
303304 copy : bool = ...,
304305 fastpath : bool = ...,
305- ) -> Series [ S1 ] : ...
306+ ) -> Self : ...
306307 @overload
307308 def __new__ (
308309 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 = ...,
315321 index : Axes | None = ...,
316322 dtype = ...,
317323 name : Hashable | None = ...,
@@ -1923,7 +1929,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]):
19231929 # ignore needed because of mypy, for using `Never` as type-var.
19241930 @overload
19251931 def sum (
1926- self : Series [Never ], # type: ignore[type-var]
1932+ self : Series [Never ],
19271933 axis : AxisIndex | None = ...,
19281934 skipna : _bool | None = ...,
19291935 level : None = ...,
@@ -2008,16 +2014,16 @@ class TimestampSeries(Series[Timestamp]):
20082014 # ignore needed because of mypy
20092015 @property
20102016 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]
20132019 @overload # type: ignore[override]
20142020 def __sub__ (
20152021 self , other : Timestamp | datetime | TimestampSeries
20162022 ) -> TimedeltaSeries : ...
20172023 @overload
20182024 def __sub__ (
20192025 self ,
2020- other : Timedelta | TimedeltaSeries | TimedeltaIndex | np .timedelta64 ,
2026+ other : timedelta | TimedeltaSeries | TimedeltaIndex | np .timedelta64 ,
20212027 ) -> TimestampSeries : ...
20222028 def __mul__ (self , other : float | Series [int ] | Series [float ] | Sequence [float ]) -> TimestampSeries : ... # type: ignore[override]
20232029 def __truediv__ (self , other : float | Series [int ] | Series [float ] | Sequence [float ]) -> TimestampSeries : ... # type: ignore[override]
0 commit comments