@@ -120,8 +120,6 @@ from pandas._libs.tslibs.nattype import NaTType
120120from pandas ._typing import (
121121 S1 ,
122122 S2 ,
123- S2_CT ,
124- S2_CT_NDT ,
125123 S2_NSDT ,
126124 T_COMPLEX ,
127125 AggFuncTypeBase ,
@@ -180,6 +178,8 @@ from pandas._typing import (
180178 ReindexMethod ,
181179 Renamer ,
182180 ReplaceValue ,
181+ S2_contra ,
182+ S2_NDT_contra ,
183183 Scalar ,
184184 ScalarT ,
185185 SequenceNotStr ,
@@ -1725,14 +1725,16 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame):
17251725 ) -> Series [Timedelta ]: ...
17261726 @overload
17271727 def __add__ (
1728- self : Supports_ProtoAdd [S2_CT , S2 ], other : S2_CT | Sequence [S2_CT ]
1728+ self : Supports_ProtoAdd [S2_contra , S2 ], other : S2_contra | Sequence [S2_contra ]
17291729 ) -> Series [S2 ]: ...
17301730 @overload
1731- def __add__ (self : Series [S2_CT ], other : SupportsRAdd [S2_CT , S2 ]) -> Series [S2 ]: ...
1731+ def __add__ (
1732+ self : Series [S2_contra ], other : SupportsRAdd [S2_contra , S2 ]
1733+ ) -> Series [S2 ]: ...
17321734 # pandas-dev/pandas#62353
17331735 @overload
17341736 def __add__ (
1735- self : Series [S2_CT_NDT ], other : Sequence [SupportsRAdd [S2_CT_NDT , S2 ]]
1737+ self : Series [S2_NDT_contra ], other : Sequence [SupportsRAdd [S2_NDT_contra , S2 ]]
17361738 ) -> Series [S2 ]: ...
17371739 @overload
17381740 def __add__ (
@@ -1835,16 +1837,16 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame):
18351837 ) -> Series [Timedelta ]: ...
18361838 @overload
18371839 def add (
1838- self : Supports_ProtoAdd [S2_CT , S2 ],
1839- other : S2_CT | Sequence [S2_CT ],
1840+ self : Supports_ProtoAdd [S2_contra , S2 ],
1841+ other : S2_contra | Sequence [S2_contra ],
18401842 level : Level | None = None ,
18411843 fill_value : float | None = None ,
18421844 axis : int = 0 ,
18431845 ) -> Series [S2 ]: ...
18441846 @overload
18451847 def add (
1846- self : Series [S2_CT ],
1847- other : SupportsRAdd [S2_CT , S2 ] | Sequence [SupportsRAdd [S2_CT , S2 ]],
1848+ self : Series [S2_contra ],
1849+ other : SupportsRAdd [S2_contra , S2 ] | Sequence [SupportsRAdd [S2_contra , S2 ]],
18481850 level : Level | None = None ,
18491851 fill_value : float | None = None ,
18501852 axis : int = 0 ,
@@ -1952,14 +1954,16 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame):
19521954 # pyright is unhappy without the above 3 overloads
19531955 @overload
19541956 def __radd__ (
1955- self : Supports_ProtoRAdd [S2_CT , S2 ], other : S2_CT | Sequence [S2_CT ]
1957+ self : Supports_ProtoRAdd [S2_contra , S2 ], other : S2_contra | Sequence [S2_contra ]
19561958 ) -> Series [S2 ]: ...
19571959 @overload
1958- def __radd__ (self : Series [S2_CT ], other : SupportsAdd [S2_CT , S2 ]) -> Series [S2 ]: ...
1960+ def __radd__ (
1961+ self : Series [S2_contra ], other : SupportsAdd [S2_contra , S2 ]
1962+ ) -> Series [S2 ]: ...
19591963 # pandas-dev/pandas#62353
19601964 @overload
19611965 def __radd__ (
1962- self : Series [S2_CT_NDT ], other : Sequence [SupportsAdd [S2_CT_NDT , S2 ]]
1966+ self : Series [S2_NDT_contra ], other : Sequence [SupportsAdd [S2_NDT_contra , S2 ]]
19631967 ) -> Series [S2 ]: ...
19641968 @overload
19651969 def __radd__ (
@@ -2066,16 +2070,16 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame):
20662070 ) -> Series [Timedelta ]: ...
20672071 @overload
20682072 def radd (
2069- self : Supports_ProtoRAdd [S2_CT , S2 ],
2070- other : S2_CT | Sequence [S2_CT ],
2073+ self : Supports_ProtoRAdd [S2_contra , S2 ],
2074+ other : S2_contra | Sequence [S2_contra ],
20712075 level : Level | None = None ,
20722076 fill_value : float | None = None ,
20732077 axis : int = 0 ,
20742078 ) -> Series [S2 ]: ...
20752079 @overload
20762080 def radd (
2077- self : Series [S2_CT ],
2078- other : SupportsAdd [S2_CT , S2 ] | Sequence [SupportsAdd [S2_CT , S2 ]],
2081+ self : Series [S2_contra ],
2082+ other : SupportsAdd [S2_contra , S2 ] | Sequence [SupportsAdd [S2_contra , S2 ]],
20792083 level : Level | None = None ,
20802084 fill_value : float | None = None ,
20812085 axis : int = 0 ,
@@ -2532,8 +2536,11 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame):
25322536 ) -> Series [S2 ]: ...
25332537 @overload
25342538 def __mul__ (
2535- self : Series [S2_CT ],
2536- other : SupportsRMul [S2_CT , S2_NSDT ] | Sequence [SupportsRMul [S2_CT , S2_NSDT ]],
2539+ self : Series [S2_contra ],
2540+ other : (
2541+ SupportsRMul [S2_contra , S2_NSDT ]
2542+ | Sequence [SupportsRMul [S2_contra , S2_NSDT ]]
2543+ ),
25372544 ) -> Series [S2_NSDT ]: ...
25382545 @overload
25392546 def __mul__ (
@@ -2625,8 +2632,11 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame):
26252632 ) -> Series [S2 ]: ...
26262633 @overload
26272634 def mul (
2628- self : Series [S2_CT ],
2629- other : SupportsRMul [S2_CT , S2_NSDT ] | Sequence [SupportsRMul [S2_CT , S2_NSDT ]],
2635+ self : Series [S2_contra ],
2636+ other : (
2637+ SupportsRMul [S2_contra , S2_NSDT ]
2638+ | Sequence [SupportsRMul [S2_contra , S2_NSDT ]]
2639+ ),
26302640 level : Level | None = None ,
26312641 fill_value : float | None = None ,
26322642 axis : int = 0 ,
@@ -2742,8 +2752,10 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame):
27422752 ) -> Series [S2 ]: ...
27432753 @overload
27442754 def __rmul__ (
2745- self : Series [S2_CT ],
2746- other : SupportsMul [S2_CT , S2_NSDT ] | Sequence [SupportsMul [S2_CT , S2_NSDT ]],
2755+ self : Series [S2_contra ],
2756+ other : (
2757+ SupportsMul [S2_contra , S2_NSDT ] | Sequence [SupportsMul [S2_contra , S2_NSDT ]]
2758+ ),
27472759 ) -> Series [S2_NSDT ]: ...
27482760 @overload
27492761 def __rmul__ (
@@ -2835,8 +2847,10 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame):
28352847 ) -> Series [S2 ]: ...
28362848 @overload
28372849 def rmul (
2838- self : Series [S2_CT ],
2839- other : SupportsMul [S2_CT , S2_NSDT ] | Sequence [SupportsMul [S2_CT , S2_NSDT ]],
2850+ self : Series [S2_contra ],
2851+ other : (
2852+ SupportsMul [S2_contra , S2_NSDT ] | Sequence [SupportsMul [S2_contra , S2_NSDT ]]
2853+ ),
28402854 level : Level | None = None ,
28412855 fill_value : float | None = None ,
28422856 axis : int = 0 ,
0 commit comments