@@ -190,7 +190,7 @@ _nonseries_timedelta: TypeAlias = _scalar_timedelta | _vector_timedelta
190
190
_nonseries_int : TypeAlias = int | np_ndarray_anyint | Sequence [int ]
191
191
192
192
_T_INT = TypeVar ("_T_INT" , bound = int )
193
- _T_STAMP = TypeVar ("_T_STAMP " , bound = Timestamp )
193
+ _T_STAMP_AND_DELTA = TypeVar ("_T_STAMP_AND_DELTA " , bound = Timestamp | Timedelta )
194
194
195
195
class _iLocIndexerSeries (_iLocIndexer , Generic [S1 ]):
196
196
# get item
@@ -1602,15 +1602,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1602
1602
) -> Series [int ]: ...
1603
1603
@overload
1604
1604
def __add__ (
1605
- self : Series [Timestamp ],
1606
- other : (
1607
- Timedelta
1608
- | Series [Timedelta ]
1609
- | TimedeltaIndex
1610
- | np .timedelta64
1611
- | timedelta
1612
- | BaseOffset
1613
- ),
1605
+ self : Series [Timestamp ], other : _nonseries_timedelta | Series [Timedelta ]
1614
1606
) -> Series [Timestamp ]: ...
1615
1607
@overload
1616
1608
def __add__ (self : Series [Timedelta ], other : Period ) -> PeriodSeries : ...
@@ -1696,7 +1688,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1696
1688
def __or__ (self , other : _nonseries_int | Series [int ]) -> Series [int ]: ...
1697
1689
@overload
1698
1690
def __radd__ (
1699
- self : Series [Timestamp ], other : Series [Timedelta ] | np . timedelta64 | timedelta
1691
+ self : Series [Timestamp ], other : _nonseries_timedelta | Series [Timedelta ]
1700
1692
) -> Series [Timestamp ]: ...
1701
1693
@overload
1702
1694
def __radd__ (
@@ -1717,14 +1709,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1717
1709
def __rdivmod__ (self , other : num | _ListLike | Series [S1 ]) -> Series [S1 ]: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
1718
1710
@overload
1719
1711
def __rfloordiv__ (
1720
- self : Series [Timedelta ],
1721
- other : (
1722
- timedelta
1723
- | Series [Timedelta ]
1724
- | np .timedelta64
1725
- | TimedeltaIndex
1726
- | Sequence [timedelta ]
1727
- ),
1712
+ self : Series [Timedelta ], other : _nonseries_timedelta | Series [Timedelta ]
1728
1713
) -> Series [int ]: ...
1729
1714
@overload
1730
1715
def __rfloordiv__ (self , other : num | _ListLike | Series [S1 ]) -> Series [S1 ]: ...
@@ -1747,16 +1732,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1747
1732
def __rsub__ (self , other : num | _ListLike | Series [S1 ]) -> Series : ...
1748
1733
@overload
1749
1734
def __rtruediv__ (
1750
- self : Series [Timedelta ],
1751
- other : (
1752
- timedelta
1753
- | Timedelta
1754
- | Sequence [Timedelta ]
1755
- | Series [Timedelta ]
1756
- | np .timedelta64
1757
- | TimedeltaIndex
1758
- | Sequence [timedelta ]
1759
- ),
1735
+ self : Series [Timedelta ], other : _nonseries_timedelta | Series [Timedelta ]
1760
1736
) -> Series [float ]: ...
1761
1737
@overload
1762
1738
def __rtruediv__ (self , other : num | _ListLike | Series [S1 ] | Path ) -> Series : ...
@@ -1774,15 +1750,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1774
1750
) -> Series [int ]: ...
1775
1751
@overload
1776
1752
def __sub__ (
1777
- self : Series [Timestamp ],
1778
- other : (
1779
- Timedelta
1780
- | Series [Timedelta ]
1781
- | TimedeltaIndex
1782
- | np .timedelta64
1783
- | timedelta
1784
- | BaseOffset
1785
- ),
1753
+ self : Series [Timestamp ], other : _nonseries_timedelta | Series [Timedelta ]
1786
1754
) -> Series [Timestamp ]: ...
1787
1755
@overload
1788
1756
def __sub__ (
@@ -1799,21 +1767,12 @@ class Series(IndexOpsMixin[S1], NDFrame):
1799
1767
def __sub__ (self , other : num | _ListLike | Series ) -> Series : ...
1800
1768
@overload
1801
1769
def __truediv__ (
1802
- self : Series [_T_STAMP ],
1770
+ self : Series [_T_STAMP_AND_DELTA ],
1803
1771
other : float | Series [int ] | Series [float ] | Sequence [float ],
1804
1772
) -> Series [Timestamp ]: ...
1805
1773
@overload
1806
1774
def __truediv__ (
1807
- self : Series [Timedelta ],
1808
- other : (
1809
- timedelta
1810
- | Timedelta
1811
- | Sequence [Timedelta ]
1812
- | Series [Timedelta ]
1813
- | np .timedelta64
1814
- | TimedeltaIndex
1815
- | Sequence [timedelta ]
1816
- ),
1775
+ self : Series [Timedelta ], other : _nonseries_timedelta | Series [Timedelta ]
1817
1776
) -> Series [float ]: ...
1818
1777
@overload
1819
1778
def __truediv__ (
@@ -2006,25 +1965,16 @@ class Series(IndexOpsMixin[S1], NDFrame):
2006
1965
numeric_only : _bool = ...,
2007
1966
** kwargs : Any ,
2008
1967
) -> S1 : ...
2009
- # @overload
2010
- # def mean(
2011
- # self: Series[Timestamp],
2012
- # axis: AxisIndex | None = ...,
2013
- # skipna: _bool = ...,
2014
- # level: None = ...,
2015
- # numeric_only: _bool = ...,
2016
- # **kwargs: Any,
2017
- # ) -> Timestamp: ...
2018
- # @overload
2019
- # def mean(
2020
- # self: Series[Timedelta],
2021
- # axis: AxisIndex | None = ...,
2022
- # skipna: _bool = ...,
2023
- # level: None = ...,
2024
- # numeric_only: _bool = ...,
2025
- # **kwargs: Any,
2026
- # ) -> Timedelta: ...
2027
- # @overload
1968
+ @overload
1969
+ def mean (
1970
+ self : Series [_T_STAMP_AND_DELTA ],
1971
+ axis : AxisIndex | None = ...,
1972
+ skipna : _bool = ...,
1973
+ level : None = ...,
1974
+ numeric_only : _bool = ...,
1975
+ ** kwargs : Any ,
1976
+ ) -> _T_STAMP_AND_DELTA : ...
1977
+ @overload
2028
1978
def mean (
2029
1979
self ,
2030
1980
axis : AxisIndex | None = ...,
0 commit comments