@@ -11,12 +11,14 @@ import numpy as np
1111import pandas as pd
1212from pandas import (
1313 DatetimeIndex ,
14- Float64Index ,
15- Int64Index ,
1614 PeriodIndex ,
1715 Series ,
1816 TimedeltaIndex ,
1917)
18+ from pandas .core .indexes .base import (
19+ _FloatIndexType ,
20+ _IntIndexType ,
21+ )
2022from pandas .core .series import (
2123 TimedeltaSeries ,
2224 TimestampSeries ,
@@ -243,7 +245,7 @@ class Timedelta(timedelta):
243245 @overload
244246 def __mul__ (self , other : Series [float ]) -> TimedeltaSeries : ...
245247 @overload
246- def __mul__ (self , other : Int64Index | Float64Index ) -> TimedeltaIndex : ...
248+ def __mul__ (self , other : _IntIndexType | _FloatIndexType ) -> TimedeltaIndex : ...
247249 @overload
248250 def __rmul__ (self , other : float ) -> Timedelta : ...
249251 @overload
@@ -253,7 +255,7 @@ class Timedelta(timedelta):
253255 @overload
254256 def __rmul__ (self , other : Series [float ]) -> TimedeltaSeries : ...
255257 @overload
256- def __rmul__ (self , other : Int64Index | Float64Index ) -> TimedeltaIndex : ...
258+ def __rmul__ (self , other : _IntIndexType | _FloatIndexType ) -> TimedeltaIndex : ...
257259 # Override due to more types supported than dt.timedelta
258260 # error: Signature of "__floordiv__" incompatible with supertype "timedelta"
259261 @overload # type: ignore[override]
@@ -269,7 +271,9 @@ class Timedelta(timedelta):
269271 self , other : npt .NDArray [np .timedelta64 ]
270272 ) -> npt .NDArray [np .int_ ]: ...
271273 @overload
272- def __floordiv__ (self , other : Int64Index | Float64Index ) -> TimedeltaIndex : ...
274+ def __floordiv__ (
275+ self , other : _IntIndexType | _FloatIndexType
276+ ) -> TimedeltaIndex : ...
273277 @overload
274278 def __floordiv__ (self , other : Series [int ]) -> TimedeltaSeries : ...
275279 @overload
@@ -302,7 +306,7 @@ class Timedelta(timedelta):
302306 @overload
303307 def __truediv__ (self , other : Series [float ]) -> TimedeltaSeries : ...
304308 @overload
305- def __truediv__ (self , other : Int64Index | Float64Index ) -> TimedeltaIndex : ...
309+ def __truediv__ (self , other : _IntIndexType | _FloatIndexType ) -> TimedeltaIndex : ...
306310 def __rtruediv__ (self , other : timedelta | Timedelta | NaTType ) -> float : ...
307311 # Override due to more types supported than dt.timedelta
308312 @overload
@@ -334,7 +338,7 @@ class Timedelta(timedelta):
334338 @overload
335339 def __mod__ (self , other : Series [int ] | Series [float ]) -> TimedeltaSeries : ...
336340 @overload
337- def __mod__ (self , other : Int64Index | Float64Index ) -> TimedeltaIndex : ...
341+ def __mod__ (self , other : _IntIndexType | _FloatIndexType ) -> TimedeltaIndex : ...
338342 @overload
339343 def __mod__ (
340344 self , other : npt .NDArray [np .integer ] | npt .NDArray [np .floating ]
0 commit comments