@@ -11,12 +11,14 @@ import numpy as np
11
11
import pandas as pd
12
12
from pandas import (
13
13
DatetimeIndex ,
14
- Float64Index ,
15
- Int64Index ,
16
14
PeriodIndex ,
17
15
Series ,
18
16
TimedeltaIndex ,
19
17
)
18
+ from pandas .core .indexes .base import (
19
+ _FloatIndexType ,
20
+ _IntIndexType ,
21
+ )
20
22
from pandas .core .series import (
21
23
TimedeltaSeries ,
22
24
TimestampSeries ,
@@ -243,7 +245,7 @@ class Timedelta(timedelta):
243
245
@overload
244
246
def __mul__ (self , other : Series [float ]) -> TimedeltaSeries : ...
245
247
@overload
246
- def __mul__ (self , other : Int64Index | Float64Index ) -> TimedeltaIndex : ...
248
+ def __mul__ (self , other : _IntIndexType | _FloatIndexType ) -> TimedeltaIndex : ...
247
249
@overload
248
250
def __rmul__ (self , other : float ) -> Timedelta : ...
249
251
@overload
@@ -253,7 +255,7 @@ class Timedelta(timedelta):
253
255
@overload
254
256
def __rmul__ (self , other : Series [float ]) -> TimedeltaSeries : ...
255
257
@overload
256
- def __rmul__ (self , other : Int64Index | Float64Index ) -> TimedeltaIndex : ...
258
+ def __rmul__ (self , other : _IntIndexType | _FloatIndexType ) -> TimedeltaIndex : ...
257
259
# Override due to more types supported than dt.timedelta
258
260
# error: Signature of "__floordiv__" incompatible with supertype "timedelta"
259
261
@overload # type: ignore[override]
@@ -269,7 +271,9 @@ class Timedelta(timedelta):
269
271
self , other : npt .NDArray [np .timedelta64 ]
270
272
) -> npt .NDArray [np .int_ ]: ...
271
273
@overload
272
- def __floordiv__ (self , other : Int64Index | Float64Index ) -> TimedeltaIndex : ...
274
+ def __floordiv__ (
275
+ self , other : _IntIndexType | _FloatIndexType
276
+ ) -> TimedeltaIndex : ...
273
277
@overload
274
278
def __floordiv__ (self , other : Series [int ]) -> TimedeltaSeries : ...
275
279
@overload
@@ -302,7 +306,7 @@ class Timedelta(timedelta):
302
306
@overload
303
307
def __truediv__ (self , other : Series [float ]) -> TimedeltaSeries : ...
304
308
@overload
305
- def __truediv__ (self , other : Int64Index | Float64Index ) -> TimedeltaIndex : ...
309
+ def __truediv__ (self , other : _IntIndexType | _FloatIndexType ) -> TimedeltaIndex : ...
306
310
def __rtruediv__ (self , other : timedelta | Timedelta | NaTType ) -> float : ...
307
311
# Override due to more types supported than dt.timedelta
308
312
@overload
@@ -334,7 +338,7 @@ class Timedelta(timedelta):
334
338
@overload
335
339
def __mod__ (self , other : Series [int ] | Series [float ]) -> TimedeltaSeries : ...
336
340
@overload
337
- def __mod__ (self , other : Int64Index | Float64Index ) -> TimedeltaIndex : ...
341
+ def __mod__ (self , other : _IntIndexType | _FloatIndexType ) -> TimedeltaIndex : ...
338
342
@overload
339
343
def __mod__ (
340
344
self , other : npt .NDArray [np .integer ] | npt .NDArray [np .floating ]
0 commit comments