@@ -188,7 +188,6 @@ from pandas.core.dtypes.dtypes import CategoricalDtype
188
188
189
189
from pandas .plotting import PlotAccessor
190
190
191
- _T_NUM_NON_BOOL = TypeVar ("_T_NUM_NON_BOOL" , int , float , complex )
192
191
_T_INT = TypeVar ("_T_INT" , bound = int )
193
192
_T_COMPLEX = TypeVar ("_T_COMPLEX" , bound = complex )
194
193
@@ -2124,8 +2123,8 @@ class Series(IndexOpsMixin[S1], NDFrame):
2124
2123
def __truediv__ (
2125
2124
self : Series [int ],
2126
2125
other : (
2127
- _T_INT
2128
- | Sequence [_T_INT ]
2126
+ int
2127
+ | Sequence [int ]
2129
2128
| np_ndarray_bool
2130
2129
| np_ndarray_anyint
2131
2130
| np_ndarray_float
@@ -2141,8 +2140,8 @@ class Series(IndexOpsMixin[S1], NDFrame):
2141
2140
def __truediv__ (
2142
2141
self : Series [float ],
2143
2142
other : (
2144
- _T_INT
2145
- | Sequence [_T_INT ]
2143
+ int
2144
+ | Sequence [int ]
2146
2145
| np_ndarray_bool
2147
2146
| np_ndarray_anyint
2148
2147
| np_ndarray_float
@@ -2155,10 +2154,6 @@ class Series(IndexOpsMixin[S1], NDFrame):
2155
2154
other : _T_COMPLEX | Sequence [_T_COMPLEX ] | Series [_T_COMPLEX ],
2156
2155
) -> Series [_T_COMPLEX ]: ...
2157
2156
@overload
2158
- def __truediv__ (
2159
- self : Series [_T_COMPLEX ], other : np_ndarray_complex
2160
- ) -> Series [complex ]: ...
2161
- @overload
2162
2157
def __truediv__ (
2163
2158
self : Series [complex ],
2164
2159
other : (
@@ -2171,6 +2166,10 @@ class Series(IndexOpsMixin[S1], NDFrame):
2171
2166
),
2172
2167
) -> Series [complex ]: ...
2173
2168
@overload
2169
+ def __truediv__ (
2170
+ self : Series [_T_COMPLEX ], other : np_ndarray_complex
2171
+ ) -> Series [complex ]: ...
2172
+ @overload
2174
2173
def __truediv__ (self , other : Path ) -> Series : ...
2175
2174
@overload
2176
2175
def truediv (
@@ -2181,7 +2180,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
2181
2180
axis : AxisIndex = 0 ,
2182
2181
) -> Series : ...
2183
2182
@overload
2184
- def truediv ( # type: ignore[overload-overlap]
2183
+ def truediv (
2185
2184
self ,
2186
2185
other : Series [Never ],
2187
2186
level : Level | None = None ,
@@ -2191,33 +2190,40 @@ class Series(IndexOpsMixin[S1], NDFrame):
2191
2190
@overload
2192
2191
def truediv (
2193
2192
self : Series [bool ],
2194
- other : bool | np_ndarray_bool | Series [ bool ] ,
2193
+ other : bool | np_ndarray_bool ,
2195
2194
level : Level | None = None ,
2196
2195
fill_value : float | None = None ,
2197
2196
axis : AxisIndex = 0 ,
2198
2197
) -> Never : ...
2199
2198
@overload
2200
- def truediv (
2199
+ def truediv ( # pyright: ignore[reportOverlappingOverload]
2201
2200
self : Series [bool ],
2202
- other : int | Sequence [int ] | np_ndarray_anyint | np_ndarray_float | Series [int ],
2201
+ other : (
2202
+ float
2203
+ | Sequence [float ]
2204
+ | np_ndarray_anyint
2205
+ | np_ndarray_float
2206
+ | Series [int ]
2207
+ | Series [float ]
2208
+ ),
2203
2209
level : Level | None = None ,
2204
2210
fill_value : float | None = None ,
2205
2211
axis : AxisIndex = 0 ,
2206
2212
) -> Series [float ]: ...
2207
2213
@overload
2208
- def truediv ( # type: ignore[overload-overlap]
2214
+ def truediv (
2209
2215
self : Series [bool ],
2210
- other : _T_NUM_NON_BOOL | Sequence [_T_NUM_NON_BOOL ] | Series [_T_NUM_NON_BOOL ],
2216
+ other : complex | Sequence [complex ] | Series [complex ],
2211
2217
level : Level | None = None ,
2212
2218
fill_value : float | None = None ,
2213
2219
axis : AxisIndex = 0 ,
2214
- ) -> Series [_T_NUM_NON_BOOL ]: ...
2220
+ ) -> Series [complex ]: ...
2215
2221
@overload
2216
2222
def truediv (
2217
2223
self : Series [int ],
2218
2224
other : (
2219
- _T_INT
2220
- | Sequence [_T_INT ]
2225
+ int
2226
+ | Sequence [int ]
2221
2227
| np_ndarray_bool
2222
2228
| np_ndarray_anyint
2223
2229
| np_ndarray_float
@@ -2259,14 +2265,6 @@ class Series(IndexOpsMixin[S1], NDFrame):
2259
2265
axis : AxisIndex = 0 ,
2260
2266
) -> Series [_T_COMPLEX ]: ...
2261
2267
@overload
2262
- def truediv (
2263
- self : Series [_T_COMPLEX ],
2264
- other : np_ndarray_complex ,
2265
- level : Level | None = None ,
2266
- fill_value : float | None = None ,
2267
- axis : AxisIndex = 0 ,
2268
- ) -> Series [complex ]: ...
2269
- @overload
2270
2268
def truediv (
2271
2269
self : Series [complex ],
2272
2270
other : (
@@ -2282,6 +2280,14 @@ class Series(IndexOpsMixin[S1], NDFrame):
2282
2280
axis : AxisIndex = 0 ,
2283
2281
) -> Series [complex ]: ...
2284
2282
@overload
2283
+ def truediv (
2284
+ self : Series [_T_COMPLEX ],
2285
+ other : np_ndarray_complex ,
2286
+ level : Level | None = None ,
2287
+ fill_value : float | None = None ,
2288
+ axis : AxisIndex = 0 ,
2289
+ ) -> Series [complex ]: ...
2290
+ @overload
2285
2291
def truediv (
2286
2292
self ,
2287
2293
other : Path ,
@@ -2295,23 +2301,19 @@ class Series(IndexOpsMixin[S1], NDFrame):
2295
2301
@overload
2296
2302
def __rtruediv__ (self : Series [bool ], other : bool | np_ndarray_bool ) -> Never : ...
2297
2303
@overload
2298
- def __rtruediv__ (
2304
+ def __rtruediv__ ( # pyright: ignore[reportOverlappingOverload]
2299
2305
self : Series [bool ],
2300
- other : int | Sequence [int ] | np_ndarray_anyint | np_ndarray_float ,
2306
+ other : float | Sequence [float ] | np_ndarray_anyint | np_ndarray_float ,
2301
2307
) -> Series [float ]: ...
2302
2308
@overload
2303
- def __rtruediv__ ( # type: ignore[overload-overlap]
2304
- self : Series [bool ], other : _T_NUM_NON_BOOL | Sequence [_T_NUM_NON_BOOL ]
2305
- ) -> Series [_T_NUM_NON_BOOL ]: ...
2309
+ def __rtruediv__ (
2310
+ self : Series [bool ], other : complex | Sequence [complex ]
2311
+ ) -> Series [complex ]: ...
2306
2312
@overload
2307
2313
def __rtruediv__ (
2308
2314
self : Series [int ],
2309
2315
other : (
2310
- _T_INT
2311
- | Sequence [_T_INT ]
2312
- | np_ndarray_bool
2313
- | np_ndarray_anyint
2314
- | np_ndarray_float
2316
+ int | Sequence [int ] | np_ndarray_bool | np_ndarray_anyint | np_ndarray_float
2315
2317
),
2316
2318
) -> Series [float ]: ...
2317
2319
@overload
@@ -2353,35 +2355,50 @@ class Series(IndexOpsMixin[S1], NDFrame):
2353
2355
axis : AxisIndex = 0 ,
2354
2356
) -> Series : ...
2355
2357
@overload
2358
+ def rtruediv (
2359
+ self ,
2360
+ other : Series [Never ],
2361
+ level : Level | None = None ,
2362
+ fill_value : float | None = None ,
2363
+ axis : AxisIndex = 0 ,
2364
+ ) -> Series : ...
2365
+ @overload
2356
2366
def rtruediv (
2357
2367
self : Series [bool ],
2358
- other : bool | np_ndarray_bool | Series [ bool ] ,
2368
+ other : bool | np_ndarray_bool ,
2359
2369
level : Level | None = None ,
2360
2370
fill_value : float | None = None ,
2361
2371
axis : AxisIndex = 0 ,
2362
2372
) -> Never : ...
2363
2373
@overload
2364
- def rtruediv (
2374
+ def rtruediv ( # pyright: ignore[reportOverlappingOverload]
2365
2375
self : Series [bool ],
2366
- other : int | Sequence [int ] | np_ndarray_anyint | np_ndarray_float | Series [int ],
2376
+ other : (
2377
+ float
2378
+ | Sequence [float ]
2379
+ | np_ndarray_anyint
2380
+ | np_ndarray_float
2381
+ | Series [int ]
2382
+ | Series [float ]
2383
+ ),
2367
2384
level : Level | None = None ,
2368
2385
fill_value : float | None = None ,
2369
2386
axis : AxisIndex = 0 ,
2370
2387
) -> Series [float ]: ...
2371
2388
@overload
2372
- def rtruediv ( # type: ignore[overload-overlap]
2389
+ def rtruediv (
2373
2390
self : Series [bool ],
2374
- other : _T_NUM_NON_BOOL | Sequence [_T_NUM_NON_BOOL ] | Series [_T_NUM_NON_BOOL ],
2391
+ other : complex | Sequence [complex ] | Series [complex ],
2375
2392
level : Level | None = None ,
2376
2393
fill_value : float | None = None ,
2377
2394
axis : AxisIndex = 0 ,
2378
- ) -> Series [_T_NUM_NON_BOOL ]: ...
2395
+ ) -> Series [complex ]: ...
2379
2396
@overload
2380
2397
def rtruediv (
2381
2398
self : Series [int ],
2382
2399
other : (
2383
- _T_INT
2384
- | Sequence [_T_INT ]
2400
+ int
2401
+ | Sequence [int ]
2385
2402
| np_ndarray_bool
2386
2403
| np_ndarray_anyint
2387
2404
| np_ndarray_float
0 commit comments