@@ -187,7 +187,7 @@ _vector_timedelta: TypeAlias = (
187
187
Sequence [timedelta ] | Sequence [Timedelta ] | TimedeltaIndex
188
188
)
189
189
_nonseries_timedelta : TypeAlias = _scalar_timedelta | _vector_timedelta
190
- _all_int : TypeAlias = int | np_ndarray_anyint | Series [ int ] | Sequence [int ]
190
+ _nonseries_int : TypeAlias = int | np_ndarray_anyint | Sequence [int ]
191
191
192
192
_T_INT = TypeVar ("_T_INT" , bound = int )
193
193
_T_STAMP_AND_DELTA = TypeVar ("_T_STAMP_AND_DELTA" , bound = Timestamp | Timedelta )
@@ -819,7 +819,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
819
819
@overload
820
820
def diff (self : Series [_str ], periods : int = ...) -> Never : ...
821
821
@overload
822
- def diff (self : Series [Timestamp ] | Series [ Timedelta ], periods : int = ...) -> Series [Timedelta ]: ... # type: ignore[overload-overlap]
822
+ def diff (self : Series [_T_STAMP_AND_DELTA ], periods : int = ...) -> Series [Timedelta ]: ... # type: ignore[overload-overlap]
823
823
@overload
824
824
def diff (self , periods : int = ...) -> Series [float ]: ...
825
825
def autocorr (self , lag : int = ...) -> float : ...
@@ -1596,7 +1596,9 @@ class Series(IndexOpsMixin[S1], NDFrame):
1596
1596
# just failed to generate these so I couldn't match
1597
1597
# them up.
1598
1598
@overload
1599
- def __add__ (self : Series [_T_INT ], other : _all_int ) -> Series [_T_INT ]: ...
1599
+ def __add__ (
1600
+ self : Series [_T_INT ], other : _nonseries_int | Series [int ]
1601
+ ) -> Series [_T_INT ]: ...
1600
1602
@overload
1601
1603
def __add__ (
1602
1604
self : Series [_T_STAMP_AND_DELTA ],
@@ -1622,7 +1624,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1622
1624
self , other : bool | list [int ] | MaskType
1623
1625
) -> Series [bool ]: ...
1624
1626
@overload
1625
- def __and__ (self , other : _all_int ) -> Series [int ]: ...
1627
+ def __and__ (self , other : _nonseries_int | Series [ int ] ) -> Series [int ]: ...
1626
1628
# def __array__(self, dtype: Optional[_bool] = ...) -> _np_ndarray
1627
1629
def __div__ (self , other : num | _ListLike | Series [S1 ]) -> Series [S1 ]: ...
1628
1630
def __eq__ (self , other : object ) -> Series [_bool ]: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
@@ -1650,7 +1652,9 @@ class Series(IndexOpsMixin[S1], NDFrame):
1650
1652
self , other : S1 | _ListLike | Series [S1 ] | datetime | timedelta | date
1651
1653
) -> Series [_bool ]: ...
1652
1654
@overload
1653
- def __mul__ (self : Series [_T_INT ], other : _all_int ) -> Series [_T_INT ]: ...
1655
+ def __mul__ (
1656
+ self : Series [_T_INT ], other : _nonseries_int | Series [int ]
1657
+ ) -> Series [_T_INT ]: ...
1654
1658
@overload
1655
1659
def __mul__ (
1656
1660
self : Series [_T_STAMP_AND_DELTA ],
@@ -1678,7 +1682,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1678
1682
self , other : bool | list [int ] | MaskType
1679
1683
) -> Series [bool ]: ...
1680
1684
@overload
1681
- def __or__ (self , other : _all_int ) -> Series [int ]: ...
1685
+ def __or__ (self , other : _nonseries_int | Series [ int ] ) -> Series [int ]: ...
1682
1686
@overload
1683
1687
def __radd__ (
1684
1688
self : Series [Timestamp ], other : _nonseries_timedelta | Series [Timedelta ]
@@ -1697,7 +1701,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1697
1701
self , other : bool | MaskType | list [int ]
1698
1702
) -> Series [bool ]: ...
1699
1703
@overload
1700
- def __rand__ (self , other : _all_int ) -> Series [int ]: ...
1704
+ def __rand__ (self , other : _nonseries_int | Series [ int ] ) -> Series [int ]: ...
1701
1705
def __rdiv__ (self , other : num | _ListLike | Series [S1 ]) -> Series [S1 ]: ...
1702
1706
def __rdivmod__ (self , other : num | _ListLike | Series [S1 ]) -> Series [S1 ]: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
1703
1707
@overload
@@ -1721,7 +1725,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1721
1725
self , other : bool | MaskType | list [int ]
1722
1726
) -> Series [bool ]: ...
1723
1727
@overload
1724
- def __ror__ (self , other : _all_int ) -> Series [int ]: ...
1728
+ def __ror__ (self , other : _nonseries_int | Series [ int ] ) -> Series [int ]: ...
1725
1729
def __rsub__ (self , other : num | _ListLike | Series [S1 ]) -> Series : ...
1726
1730
@overload
1727
1731
def __rtruediv__ (
@@ -1735,9 +1739,11 @@ class Series(IndexOpsMixin[S1], NDFrame):
1735
1739
self , other : bool | MaskType | list [int ]
1736
1740
) -> Series [bool ]: ...
1737
1741
@overload
1738
- def __rxor__ (self , other : _all_int ) -> Series [int ]: ...
1742
+ def __rxor__ (self , other : _nonseries_int | Series [ int ] ) -> Series [int ]: ...
1739
1743
@overload
1740
- def __sub__ (self : Series [_T_INT ], other : _all_int ) -> Series [_T_INT ]: ...
1744
+ def __sub__ (
1745
+ self : Series [_T_INT ], other : _nonseries_int | Series [int ]
1746
+ ) -> Series [_T_INT ]: ...
1741
1747
@overload
1742
1748
def __sub__ ( # type: ignore[overload-overlap]
1743
1749
self : Series [Timestamp ], other : _nonseries_timedelta | Series [Timedelta ]
@@ -1769,7 +1775,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1769
1775
self , other : bool | MaskType | list [int ]
1770
1776
) -> Series [bool ]: ...
1771
1777
@overload
1772
- def __xor__ (self , other : _all_int ) -> Series [int ]: ...
1778
+ def __xor__ (self , other : _nonseries_int | Series [ int ] ) -> Series [int ]: ...
1773
1779
def __invert__ (self ) -> Series [bool ]: ...
1774
1780
# properties
1775
1781
# @property
@@ -1831,7 +1837,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1831
1837
) -> Never : ...
1832
1838
@overload
1833
1839
def cumprod (
1834
- self : Series [Timestamp ] | Series [ Timedelta ],
1840
+ self : Series [_T_STAMP_AND_DELTA ],
1835
1841
axis : AxisIndex = ...,
1836
1842
skipna : _bool = ...,
1837
1843
* args : Any ,
@@ -2163,7 +2169,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
2163
2169
) -> Scalar : ...
2164
2170
@overload
2165
2171
def std (
2166
- self : Series [Timestamp ] | Series [ Timedelta ],
2172
+ self : Series [_T_STAMP_AND_DELTA ],
2167
2173
axis : AxisIndex | None = ...,
2168
2174
skipna : _bool | None = ...,
2169
2175
level : None = ...,
0 commit comments