@@ -205,7 +205,7 @@ _nonseries_timedelta: TypeAlias = _scalar_timedelta | _vector_timedelta
205
205
_nonseries_int : TypeAlias = int | np_ndarray_anyint | Sequence [int ]
206
206
207
207
_T_INT = TypeVar ("_T_INT" , bound = int )
208
- _T_STAMP = TypeVar ("_T_STAMP " , bound = Timestamp )
208
+ _T_STAMP_AND_DELTA = TypeVar ("_T_STAMP_AND_DELTA " , bound = Timestamp | Timedelta )
209
209
210
210
class _iLocIndexerSeries (_iLocIndexer , Generic [S1 ]):
211
211
# get item
@@ -1620,15 +1620,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1620
1620
) -> Never : ...
1621
1621
@overload
1622
1622
def __add__ (
1623
- self : Series [Timestamp ],
1624
- other : (
1625
- Timedelta
1626
- | Series [Timedelta ]
1627
- | TimedeltaIndex
1628
- | np .timedelta64
1629
- | timedelta
1630
- | BaseOffset
1631
- ),
1623
+ self : Series [Timestamp ], other : _nonseries_timedelta | Series [Timedelta ]
1632
1624
) -> Series [Timestamp ]: ...
1633
1625
@overload
1634
1626
def __add__ (self : Series [Timedelta ], other : Period ) -> PeriodSeries : ...
@@ -1713,7 +1705,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1713
1705
def __or__ (self , other : _nonseries_int | Series [int ]) -> Series [int ]: ...
1714
1706
@overload
1715
1707
def __radd__ (
1716
- self : Series [Timestamp ], other : Series [Timedelta ] | np . timedelta64 | timedelta
1708
+ self : Series [Timestamp ], other : _nonseries_timedelta | Series [Timedelta ]
1717
1709
) -> Series [Timestamp ]: ...
1718
1710
@overload
1719
1711
def __radd__ (
@@ -1734,14 +1726,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1734
1726
def __rdivmod__ (self , other : num | _ListLike | Series [S1 ]) -> Series [S1 ]: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
1735
1727
@overload
1736
1728
def __rfloordiv__ (
1737
- self : Series [Timedelta ],
1738
- other : (
1739
- timedelta
1740
- | Series [Timedelta ]
1741
- | np .timedelta64
1742
- | TimedeltaIndex
1743
- | Sequence [timedelta ]
1744
- ),
1729
+ self : Series [Timedelta ], other : _nonseries_timedelta | Series [Timedelta ]
1745
1730
) -> Series [int ]: ...
1746
1731
@overload
1747
1732
def __rfloordiv__ (self , other : num | _ListLike | Series [S1 ]) -> Series [S1 ]: ...
@@ -1764,16 +1749,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1764
1749
def __rsub__ (self , other : num | _ListLike | Series [S1 ]) -> Series : ...
1765
1750
@overload
1766
1751
def __rtruediv__ (
1767
- self : Series [Timedelta ],
1768
- other : (
1769
- timedelta
1770
- | Timedelta
1771
- | Sequence [Timedelta ]
1772
- | Series [Timedelta ]
1773
- | np .timedelta64
1774
- | TimedeltaIndex
1775
- | Sequence [timedelta ]
1776
- ),
1752
+ self : Series [Timedelta ], other : _nonseries_timedelta | Series [Timedelta ]
1777
1753
) -> Series [float ]: ...
1778
1754
@overload
1779
1755
def __rtruediv__ (self , other : num | _ListLike | Series [S1 ] | Path ) -> Series : ...
@@ -1791,15 +1767,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1791
1767
) -> Series [int ]: ...
1792
1768
@overload
1793
1769
def __sub__ (
1794
- self : Series [Timestamp ],
1795
- other : (
1796
- Timedelta
1797
- | Series [Timedelta ]
1798
- | TimedeltaIndex
1799
- | np .timedelta64
1800
- | timedelta
1801
- | BaseOffset
1802
- ),
1770
+ self : Series [Timestamp ], other : _nonseries_timedelta | Series [Timedelta ]
1803
1771
) -> Series [Timestamp ]: ...
1804
1772
@overload
1805
1773
def __sub__ (
@@ -1816,21 +1784,12 @@ class Series(IndexOpsMixin[S1], NDFrame):
1816
1784
def __sub__ (self , other : num | _ListLike | Series ) -> Series : ...
1817
1785
@overload
1818
1786
def __truediv__ (
1819
- self : Series [_T_STAMP ],
1787
+ self : Series [_T_STAMP_AND_DELTA ],
1820
1788
other : float | Series [int ] | Series [float ] | Sequence [float ],
1821
1789
) -> Series [Timestamp ]: ...
1822
1790
@overload
1823
1791
def __truediv__ (
1824
- self : Series [Timedelta ],
1825
- other : (
1826
- timedelta
1827
- | Timedelta
1828
- | Sequence [Timedelta ]
1829
- | Series [Timedelta ]
1830
- | np .timedelta64
1831
- | TimedeltaIndex
1832
- | Sequence [timedelta ]
1833
- ),
1792
+ self : Series [Timedelta ], other : _nonseries_timedelta | Series [Timedelta ]
1834
1793
) -> Series [float ]: ...
1835
1794
@overload
1836
1795
def __truediv__ (
@@ -2023,25 +1982,16 @@ class Series(IndexOpsMixin[S1], NDFrame):
2023
1982
numeric_only : _bool = ...,
2024
1983
** kwargs : Any ,
2025
1984
) -> S1 : ...
2026
- # @overload
2027
- # def mean(
2028
- # self: Series[Timestamp],
2029
- # axis: AxisIndex | None = ...,
2030
- # skipna: _bool = ...,
2031
- # level: None = ...,
2032
- # numeric_only: _bool = ...,
2033
- # **kwargs: Any,
2034
- # ) -> Timestamp: ...
2035
- # @overload
2036
- # def mean(
2037
- # self: Series[Timedelta],
2038
- # axis: AxisIndex | None = ...,
2039
- # skipna: _bool = ...,
2040
- # level: None = ...,
2041
- # numeric_only: _bool = ...,
2042
- # **kwargs: Any,
2043
- # ) -> Timedelta: ...
2044
- # @overload
1985
+ @overload
1986
+ def mean (
1987
+ self : Series [_T_STAMP_AND_DELTA ],
1988
+ axis : AxisIndex | None = ...,
1989
+ skipna : _bool = ...,
1990
+ level : None = ...,
1991
+ numeric_only : _bool = ...,
1992
+ ** kwargs : Any ,
1993
+ ) -> _T_STAMP_AND_DELTA : ...
1994
+ @overload
2045
1995
def mean (
2046
1996
self ,
2047
1997
axis : AxisIndex | None = ...,
0 commit comments