@@ -17,7 +17,6 @@ from pandas import (
1717 Series ,
1818 TimedeltaIndex ,
1919)
20- from pandas .core .series import TimedeltaSeries
2120from typing_extensions import (
2221 Self ,
2322 TypeAlias ,
@@ -159,10 +158,7 @@ class Timedelta(timedelta):
159158 @overload
160159 def __add__ (self , other : pd .TimedeltaIndex ) -> pd .TimedeltaIndex : ...
161160 @overload
162- def __add__ (
163- self ,
164- other : TimedeltaSeries ,
165- ) -> TimedeltaSeries : ...
161+ def __add__ (self , other : Series [Timedelta ]) -> Series [Timedelta ]: ...
166162 @overload
167163 def __add__ (self , other : Series [Timestamp ]) -> Series [Timestamp ]: ...
168164 @overload
@@ -195,9 +191,7 @@ class Timedelta(timedelta):
195191 @overload
196192 def __sub__ (self , other : pd .TimedeltaIndex ) -> TimedeltaIndex : ...
197193 @overload
198- def __sub__ (
199- self , other : TimedeltaSeries | Series [pd .Timedelta ]
200- ) -> TimedeltaSeries : ...
194+ def __sub__ (self , other : Series [pd .Timedelta ]) -> Series [pd .Timedelta ]: ...
201195 @overload
202196 def __rsub__ (self , other : timedelta | Timedelta | np .timedelta64 ) -> Timedelta : ...
203197 @overload
@@ -231,9 +225,9 @@ class Timedelta(timedelta):
231225 self , other : npt .NDArray [np .integer ] | npt .NDArray [np .floating ]
232226 ) -> npt .NDArray [np .timedelta64 ]: ...
233227 @overload
234- def __mul__ (self , other : Series [int ]) -> TimedeltaSeries : ...
228+ def __mul__ (self , other : Series [int ]) -> Series [ Timedelta ] : ...
235229 @overload
236- def __mul__ (self , other : Series [float ]) -> TimedeltaSeries : ...
230+ def __mul__ (self , other : Series [float ]) -> Series [ Timedelta ] : ...
237231 @overload
238232 def __mul__ (self , other : Index [int ] | Index [float ]) -> TimedeltaIndex : ...
239233 @overload
@@ -243,9 +237,9 @@ class Timedelta(timedelta):
243237 self , other : npt .NDArray [np .floating ] | npt .NDArray [np .integer ]
244238 ) -> npt .NDArray [np .timedelta64 ]: ...
245239 @overload
246- def __rmul__ (self , other : Series [int ]) -> TimedeltaSeries : ...
240+ def __rmul__ (self , other : Series [int ]) -> Series [ Timedelta ] : ...
247241 @overload
248- def __rmul__ (self , other : Series [float ]) -> TimedeltaSeries : ...
242+ def __rmul__ (self , other : Series [float ]) -> Series [ Timedelta ] : ...
249243 # maybe related to https://github.com/python/mypy/issues/10755
250244 @overload
251245 def __rmul__ (self , other : Index [int ] | Index [float ]) -> TimedeltaIndex : ...
@@ -266,11 +260,11 @@ class Timedelta(timedelta):
266260 @overload
267261 def __floordiv__ (self , other : Index [int ] | Index [float ]) -> TimedeltaIndex : ...
268262 @overload
269- def __floordiv__ (self , other : Series [int ]) -> TimedeltaSeries : ...
263+ def __floordiv__ (self , other : Series [int ]) -> Series [ Timedelta ] : ...
270264 @overload
271- def __floordiv__ (self , other : Series [float ]) -> TimedeltaSeries : ...
265+ def __floordiv__ (self , other : Series [float ]) -> Series [ Timedelta ] : ...
272266 @overload
273- def __floordiv__ (self , other : TimedeltaSeries ) -> Series [int ]: ...
267+ def __floordiv__ (self , other : Series [ Timedelta ] ) -> Series [int ]: ...
274268 @overload
275269 def __floordiv__ (self , other : NaTType | None ) -> float : ...
276270 @overload
@@ -291,19 +285,19 @@ class Timedelta(timedelta):
291285 self , other : npt .NDArray [np .integer ] | npt .NDArray [np .floating ]
292286 ) -> npt .NDArray [np .timedelta64 ]: ...
293287 @overload
294- def __truediv__ (self , other : TimedeltaSeries ) -> Series [float ]: ...
288+ def __truediv__ (self , other : Series [ Timedelta ] ) -> Series [float ]: ...
295289 @overload
296- def __truediv__ (self , other : Series [int ]) -> TimedeltaSeries : ...
290+ def __truediv__ (self , other : Series [int ]) -> Series [ Timedelta ] : ...
297291 @overload
298- def __truediv__ (self , other : Series [float ]) -> TimedeltaSeries : ...
292+ def __truediv__ (self , other : Series [float ]) -> Series [ Timedelta ] : ...
299293 @overload
300294 def __truediv__ (self , other : Index [int ] | Index [float ]) -> TimedeltaIndex : ...
301295 def __rtruediv__ (self , other : timedelta | Timedelta | NaTType ) -> float : ...
302296 # Override due to more types supported than dt.timedelta
303297 @overload
304298 def __eq__ (self , other : timedelta | Timedelta | np .timedelta64 ) -> bool : ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
305299 @overload
306- def __eq__ (self , other : TimedeltaSeries | Series [pd . Timedelta ]) -> Series [bool ]: ... # type: ignore[overload-overlap]
300+ def __eq__ (self , other : Series [Timedelta ]) -> Series [bool ]: ... # type: ignore[overload-overlap]
307301 @overload
308302 def __eq__ ( # type: ignore[overload-overlap]
309303 self , other : TimedeltaIndex | npt .NDArray [np .timedelta64 ]
@@ -314,7 +308,7 @@ class Timedelta(timedelta):
314308 @overload
315309 def __ne__ (self , other : timedelta | Timedelta | np .timedelta64 ) -> bool : ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
316310 @overload
317- def __ne__ (self , other : TimedeltaSeries | Series [pd .Timedelta ]) -> Series [bool ]: ... # type: ignore[overload-overlap]
311+ def __ne__ (self , other : Series [pd .Timedelta ]) -> Series [bool ]: ... # type: ignore[overload-overlap]
318312 @overload
319313 def __ne__ ( # type: ignore[overload-overlap]
320314 self , other : TimedeltaIndex | npt .NDArray [np .timedelta64 ]
@@ -327,7 +321,7 @@ class Timedelta(timedelta):
327321 @overload
328322 def __mod__ (self , other : float ) -> Timedelta : ...
329323 @overload
330- def __mod__ (self , other : Series [int ] | Series [float ]) -> TimedeltaSeries : ...
324+ def __mod__ (self , other : Series [int ] | Series [float ]) -> Series [ Timedelta ] : ...
331325 @overload
332326 def __mod__ (self , other : Index [int ] | Index [float ]) -> TimedeltaIndex : ...
333327 @overload
@@ -336,8 +330,8 @@ class Timedelta(timedelta):
336330 ) -> npt .NDArray [np .timedelta64 ]: ...
337331 @overload
338332 def __mod__ (
339- self , other : Series [int ] | Series [float ] | TimedeltaSeries
340- ) -> TimedeltaSeries : ...
333+ self , other : Series [int ] | Series [float ] | Series [ Timedelta ]
334+ ) -> Series [ Timedelta ] : ...
341335 def __divmod__ (self , other : timedelta ) -> tuple [int , Timedelta ]: ...
342336 # Mypy complains Forward operator "<inequality op>" is not callable, so ignore misc
343337 # for le, lt ge and gt
@@ -349,7 +343,7 @@ class Timedelta(timedelta):
349343 self , other : TimedeltaIndex | npt .NDArray [np .timedelta64 ]
350344 ) -> npt .NDArray [np .bool_ ]: ...
351345 @overload
352- def __le__ (self , other : TimedeltaSeries | Series [pd .Timedelta ]) -> Series [bool ]: ...
346+ def __le__ (self , other : Series [pd .Timedelta ]) -> Series [bool ]: ...
353347 # Override due to more types supported than dt.timedelta
354348 @overload # type: ignore[override]
355349 def __lt__ (self , other : timedelta | Timedelta | np .timedelta64 ) -> bool : ... # type: ignore[misc]
@@ -358,7 +352,7 @@ class Timedelta(timedelta):
358352 self , other : TimedeltaIndex | npt .NDArray [np .timedelta64 ]
359353 ) -> npt .NDArray [np .bool_ ]: ...
360354 @overload
361- def __lt__ (self , other : TimedeltaSeries | Series [pd .Timedelta ]) -> Series [bool ]: ...
355+ def __lt__ (self , other : Series [pd .Timedelta ]) -> Series [bool ]: ...
362356 # Override due to more types supported than dt.timedelta
363357 @overload # type: ignore[override]
364358 def __ge__ (self , other : timedelta | Timedelta | np .timedelta64 ) -> bool : ... # type: ignore[misc]
@@ -367,7 +361,7 @@ class Timedelta(timedelta):
367361 self , other : TimedeltaIndex | npt .NDArray [np .timedelta64 ]
368362 ) -> npt .NDArray [np .bool_ ]: ...
369363 @overload
370- def __ge__ (self , other : TimedeltaSeries | Series [pd .Timedelta ]) -> Series [bool ]: ...
364+ def __ge__ (self , other : Series [pd .Timedelta ]) -> Series [bool ]: ...
371365 # Override due to more types supported than dt.timedelta
372366 @overload # type: ignore[override]
373367 def __gt__ (self , other : timedelta | Timedelta | np .timedelta64 ) -> bool : ... # type: ignore[misc]
@@ -376,7 +370,7 @@ class Timedelta(timedelta):
376370 self , other : TimedeltaIndex | npt .NDArray [np .timedelta64 ]
377371 ) -> npt .NDArray [np .bool_ ]: ...
378372 @overload
379- def __gt__ (self , other : TimedeltaSeries | Series [pd .Timedelta ]) -> Series [bool ]: ...
373+ def __gt__ (self , other : Series [pd .Timedelta ]) -> Series [bool ]: ...
380374 def __hash__ (self ) -> int : ...
381375 def isoformat (self ) -> str : ...
382376 def to_numpy (self ) -> np .timedelta64 : ...
0 commit comments