Skip to content

Commit 1853a8d

Browse files
committed
fix(comment): make __r__ and r identical
1 parent 6f39da6 commit 1853a8d

File tree

1 file changed

+62
-49
lines changed

1 file changed

+62
-49
lines changed

pandas-stubs/core/series.pyi

Lines changed: 62 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1821,7 +1821,8 @@ class Series(IndexOpsMixin[S1], NDFrame):
18211821
def __radd__(self: Series[Never], other: Scalar | _ListLike) -> Series: ...
18221822
@overload
18231823
def __radd__(
1824-
self: Series[bool], other: _T_COMPLEX | Sequence[_T_COMPLEX]
1824+
self: Series[bool],
1825+
other: _T_COMPLEX | Sequence[_T_COMPLEX] | Series[_T_COMPLEX],
18251826
) -> Series[_T_COMPLEX]: ...
18261827
@overload
18271828
def __radd__(self: Series[bool], other: np_ndarray_bool) -> Series[bool]: ...
@@ -1830,45 +1831,51 @@ class Series(IndexOpsMixin[S1], NDFrame):
18301831
@overload
18311832
def __radd__(self: Series[bool], other: np_ndarray_float) -> Series[float]: ...
18321833
@overload
1833-
def __radd__(self: Series[bool], other: np_ndarray_complex) -> Series[complex]: ...
1834-
@overload
18351834
def __radd__(
18361835
self: Series[int],
1837-
other: bool | Sequence[bool] | np_ndarray_bool | np_ndarray_anyint,
1836+
other: (
1837+
bool | Sequence[bool] | np_ndarray_bool | np_ndarray_anyint | Series[bool]
1838+
),
18381839
) -> Series[int]: ...
18391840
@overload
18401841
def __radd__(
1841-
self: Series[int], other: _T_COMPLEX | Sequence[_T_COMPLEX]
1842+
self: Series[int], other: _T_COMPLEX | Sequence[_T_COMPLEX] | Series[_T_COMPLEX]
18421843
) -> Series[_T_COMPLEX]: ...
18431844
@overload
18441845
def __radd__(self: Series[int], other: np_ndarray_float) -> Series[float]: ...
18451846
@overload
1846-
def __radd__(self: Series[int], other: np_ndarray_complex) -> Series[complex]: ...
1847-
@overload
18481847
def __radd__(
18491848
self: Series[float],
18501849
other: (
1851-
int | Sequence[int] | np_ndarray_bool | np_ndarray_anyint | np_ndarray_float
1850+
int
1851+
| Sequence[int]
1852+
| np_ndarray_bool
1853+
| np_ndarray_anyint
1854+
| np_ndarray_float
1855+
| Series[_T_INT]
18521856
),
18531857
) -> Series[float]: ...
18541858
@overload
18551859
def __radd__(
1856-
self: Series[float], other: _T_COMPLEX | Sequence[_T_COMPLEX]
1860+
self: Series[float],
1861+
other: _T_COMPLEX | Sequence[_T_COMPLEX] | Series[_T_COMPLEX],
18571862
) -> Series[_T_COMPLEX]: ...
18581863
@overload
1859-
def __radd__(self: Series[float], other: np_ndarray_complex) -> Series[complex]: ...
1860-
@overload
18611864
def __radd__(
18621865
self: Series[complex],
18631866
other: (
1864-
np_ndarray_bool
1867+
Sequence[_T_COMPLEX]
1868+
| np_ndarray_bool
18651869
| np_ndarray_anyint
18661870
| np_ndarray_float
1867-
| np_ndarray_complex
1868-
| Sequence[_T_COMPLEX]
1871+
| Series[_T_COMPLEX]
18691872
),
18701873
) -> Series[complex]: ...
18711874
@overload
1875+
def __radd__(
1876+
self: Series[_T_COMPLEX], other: np_ndarray_complex
1877+
) -> Series[complex]: ...
1878+
@overload
18721879
def __radd__(self, other: S1) -> Self: ...
18731880
@overload
18741881
def radd(
@@ -1895,14 +1902,6 @@ class Series(IndexOpsMixin[S1], NDFrame):
18951902
axis: int = 0,
18961903
) -> Series[bool]: ...
18971904
@overload
1898-
def radd(
1899-
self: Series[bool],
1900-
other: np_ndarray_anyint,
1901-
level: Level | None = None,
1902-
fill_value: float | None = None,
1903-
axis: int = 0,
1904-
) -> Series[int]: ...
1905-
@overload
19061905
def radd(
19071906
self: Series[bool],
19081907
other: np_ndarray_float,
@@ -1913,11 +1912,11 @@ class Series(IndexOpsMixin[S1], NDFrame):
19131912
@overload
19141913
def radd(
19151914
self: Series[bool],
1916-
other: np_ndarray_complex,
1915+
other: np_ndarray_anyint,
19171916
level: Level | None = None,
19181917
fill_value: float | None = None,
19191918
axis: int = 0,
1920-
) -> Series[complex]: ...
1919+
) -> Series[int]: ...
19211920
@overload
19221921
def radd(
19231922
self: Series[int],
@@ -1945,14 +1944,6 @@ class Series(IndexOpsMixin[S1], NDFrame):
19451944
axis: int = 0,
19461945
) -> Series[float]: ...
19471946
@overload
1948-
def radd(
1949-
self: Series[int],
1950-
other: np_ndarray_complex,
1951-
level: Level | None = None,
1952-
fill_value: float | None = None,
1953-
axis: int = 0,
1954-
) -> Series[complex]: ...
1955-
@overload
19561947
def radd(
19571948
self: Series[float],
19581949
other: (
@@ -1976,29 +1967,28 @@ class Series(IndexOpsMixin[S1], NDFrame):
19761967
axis: int = 0,
19771968
) -> Series[_T_COMPLEX]: ...
19781969
@overload
1979-
def radd(
1980-
self: Series[float],
1981-
other: np_ndarray_complex,
1982-
level: Level | None = None,
1983-
fill_value: float | None = None,
1984-
axis: int = 0,
1985-
) -> Series[complex]: ...
1986-
@overload
19871970
def radd(
19881971
self: Series[complex],
19891972
other: (
19901973
Sequence[_T_COMPLEX]
19911974
| np_ndarray_bool
19921975
| np_ndarray_anyint
19931976
| np_ndarray_float
1994-
| np_ndarray_complex
19951977
| Series[_T_COMPLEX]
19961978
),
19971979
level: Level | None = None,
19981980
fill_value: float | None = None,
19991981
axis: int = 0,
20001982
) -> Series[complex]: ...
20011983
@overload
1984+
def radd(
1985+
self: Series[_T_COMPLEX],
1986+
other: np_ndarray_complex,
1987+
level: Level | None = None,
1988+
fill_value: float | None = None,
1989+
axis: int = 0,
1990+
) -> Series[complex]: ...
1991+
@overload
20021992
def radd(
20031993
self,
20041994
other: S1 | Series[S1],
@@ -2293,39 +2283,61 @@ class Series(IndexOpsMixin[S1], NDFrame):
22932283
) -> Series: ...
22942284
div = truediv
22952285
@overload
2296-
def __rtruediv__(self: Series[Never], other: complex | _ListLike) -> Series: ...
2286+
def __rtruediv__(
2287+
self: Series[Never], other: complex | _ListLike | Series
2288+
) -> Series: ...
2289+
@overload
2290+
def __rtruediv__(self, other: Series[Never]) -> Series: ...
22972291
@overload
22982292
def __rtruediv__(self: Series[bool], other: bool | np_ndarray_bool) -> Never: ...
22992293
@overload
23002294
def __rtruediv__( # pyright: ignore[reportOverlappingOverload]
23012295
self: Series[bool],
2302-
other: float | Sequence[float] | np_ndarray_anyint | np_ndarray_float,
2296+
other: (
2297+
float
2298+
| Sequence[float]
2299+
| np_ndarray_anyint
2300+
| np_ndarray_float
2301+
| Series[int]
2302+
| Series[float]
2303+
),
23032304
) -> Series[float]: ...
23042305
@overload
23052306
def __rtruediv__(
2306-
self: Series[bool], other: complex | Sequence[complex]
2307+
self: Series[bool], other: complex | Sequence[complex] | Series[complex]
23072308
) -> Series[complex]: ...
23082309
@overload
23092310
def __rtruediv__(
23102311
self: Series[int],
23112312
other: (
2312-
int | Sequence[int] | np_ndarray_bool | np_ndarray_anyint | np_ndarray_float
2313+
int
2314+
| Sequence[int]
2315+
| np_ndarray_bool
2316+
| np_ndarray_anyint
2317+
| np_ndarray_float
2318+
| Series[_T_INT]
23132319
),
23142320
) -> Series[float]: ...
23152321
@overload
23162322
def __rtruediv__(
2317-
self: Series[int], other: _T_COMPLEX | Sequence[_T_COMPLEX]
2323+
self: Series[int], other: _T_COMPLEX | Sequence[_T_COMPLEX] | Series[_T_COMPLEX]
23182324
) -> Series[_T_COMPLEX]: ...
23192325
@overload
23202326
def __rtruediv__(
23212327
self: Series[float],
23222328
other: (
2323-
int | Sequence[int] | np_ndarray_bool | np_ndarray_anyint | np_ndarray_float
2329+
int
2330+
| Sequence[int]
2331+
| np_ndarray_bool
2332+
| np_ndarray_anyint
2333+
| np_ndarray_float
2334+
| Series[_T_INT]
23242335
),
23252336
) -> Series[float]: ...
23262337
@overload
23272338
def __rtruediv__(
2328-
self: Series[float], other: _T_COMPLEX | Sequence[_T_COMPLEX]
2339+
self: Series[float],
2340+
other: _T_COMPLEX | Sequence[_T_COMPLEX] | Series[_T_COMPLEX],
23292341
) -> Series[_T_COMPLEX]: ...
23302342
@overload
23312343
def __rtruediv__(
@@ -2336,6 +2348,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
23362348
| np_ndarray_bool
23372349
| np_ndarray_anyint
23382350
| np_ndarray_float
2351+
| Series[_T_COMPLEX]
23392352
),
23402353
) -> Series[complex]: ...
23412354
@overload
@@ -3112,7 +3125,7 @@ class PeriodSeries(Series[Period]):
31123125
) -> Never: ...
31133126

31143127
class OffsetSeries(Series[BaseOffset]):
3115-
@overload
3128+
@overload # type: ignore[override]
31163129
def __radd__(self, other: Period) -> PeriodSeries: ...
31173130
@overload
31183131
def __radd__( # pyright: ignore[reportIncompatibleMethodOverride]

0 commit comments

Comments
 (0)