Skip to content

Commit 2576640

Browse files
committed
fix(comment): argument types #1275 (review)
1 parent fe4e10a commit 2576640

File tree

1 file changed

+9
-32
lines changed

1 file changed

+9
-32
lines changed

pandas-stubs/core/series.pyi

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,10 +1624,10 @@ class Series(IndexOpsMixin[S1], NDFrame):
16241624
@overload
16251625
def __add__(
16261626
self: Series[Never],
1627-
other: num | _str | timedelta | Timedelta | _ListLike | Series | np.timedelta64,
1627+
other: Scalar | _ListLike | Series,
16281628
) -> Series: ...
16291629
@overload
1630-
def __add__(self: Series, other: Series[Never]) -> Series: ...
1630+
def __add__(self, other: Series[Never]) -> Series: ...
16311631
@overload
16321632
def __add__(
16331633
self: Series[int], other: _T_COMPLEX | Sequence[_T_COMPLEX] | Series[_T_COMPLEX]
@@ -1664,11 +1664,6 @@ class Series(IndexOpsMixin[S1], NDFrame):
16641664
) -> Series[complex]: ...
16651665
@overload
16661666
def __add__(self, other: S1 | Self) -> Self: ...
1667-
@overload
1668-
def __add__(
1669-
self,
1670-
other: num | _str | timedelta | Timedelta | _ListLike | Series | np.timedelta64,
1671-
) -> Series: ...
16721667
# ignore needed for mypy as we want different results based on the arguments
16731668
@overload # type: ignore[override]
16741669
def __and__( # pyright: ignore[reportOverlappingOverload]
@@ -1709,9 +1704,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
17091704
@overload
17101705
def __or__(self, other: int | np_ndarray_anyint | Series[int]) -> Series[int]: ...
17111706
@overload
1712-
def __radd__(
1713-
self: Series[Never], other: num | _str | _ListLike | Series
1714-
) -> Series: ...
1707+
def __radd__(self: Series[Never], other: Scalar | _ListLike | Series) -> Series: ...
17151708
@overload
17161709
def __radd__(
17171710
self: Series[int], other: _T_COMPLEX | Sequence[_T_COMPLEX]
@@ -1728,8 +1721,6 @@ class Series(IndexOpsMixin[S1], NDFrame):
17281721
) -> Series[complex]: ...
17291722
@overload
17301723
def __radd__(self, other: S1 | Series[S1]) -> Self: ...
1731-
@overload
1732-
def __radd__(self, other: num | _str | _ListLike | Series) -> Series: ...
17331724
# ignore needed for mypy as we want different results based on the arguments
17341725
@overload # type: ignore[override]
17351726
def __rand__( # pyright: ignore[reportOverlappingOverload]
@@ -1808,14 +1799,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
18081799
@overload
18091800
def add(
18101801
self: Series[Never],
1811-
other: (
1812-
Sequence
1813-
| np_ndarray_anyint
1814-
| np_ndarray_float
1815-
| np_ndarray_complex
1816-
| Series
1817-
| Scalar
1818-
),
1802+
other: Scalar | _ListLike | Series,
18191803
level: Level | None = ...,
18201804
fill_value: float | None = ...,
18211805
axis: int = ...,
@@ -1893,11 +1877,11 @@ class Series(IndexOpsMixin[S1], NDFrame):
18931877
@overload
18941878
def add(
18951879
self,
1896-
other: Series[S1] | Scalar,
1880+
other: S1 | Series[S1],
18971881
level: Level | None = ...,
18981882
fill_value: float | None = ...,
18991883
axis: int = ...,
1900-
) -> Series[S1]: ...
1884+
) -> Self: ...
19011885
def all(
19021886
self,
19031887
axis: AxisIndex = ...,
@@ -2138,14 +2122,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
21382122
@overload
21392123
def radd(
21402124
self: Series[Never],
2141-
other: (
2142-
Sequence
2143-
| np_ndarray_anyint
2144-
| np_ndarray_float
2145-
| np_ndarray_complex
2146-
| Series
2147-
| Scalar
2148-
),
2125+
other: Scalar | _ListLike | Series,
21492126
level: Level | None = ...,
21502127
fill_value: float | None = ...,
21512128
axis: AxisIndex = ...,
@@ -2223,11 +2200,11 @@ class Series(IndexOpsMixin[S1], NDFrame):
22232200
@overload
22242201
def radd(
22252202
self,
2226-
other: Series[S1] | Scalar,
2203+
other: S1 | Series[S1],
22272204
level: Level | None = ...,
22282205
fill_value: float | None = ...,
22292206
axis: AxisIndex = ...,
2230-
) -> Series[S1]: ...
2207+
) -> Self: ...
22312208
def rdivmod(
22322209
self,
22332210
other: Series[S1] | Scalar,

0 commit comments

Comments
 (0)