@@ -37,7 +37,7 @@ def _divide_and_round(a: float, b: float) -> int:
37
37
# positive, 2 * r < b if b negative.
38
38
r *= 2
39
39
greater_than_half = r > b if b > 0 else r < b
40
- if greater_than_half or r == b and q % 2 == 1 :
40
+ if greater_than_half or ( r == b and q % 2 == 1 ) :
41
41
q += 1
42
42
43
43
return q
@@ -375,12 +375,10 @@ def __mul__(self, other: int | float) -> Self:
375
375
__rmul__ = __mul__
376
376
377
377
@overload
378
- def __floordiv__ (self , other : timedelta ) -> int :
379
- ...
378
+ def __floordiv__ (self , other : timedelta ) -> int : ...
380
379
381
380
@overload
382
- def __floordiv__ (self , other : int ) -> Self :
383
- ...
381
+ def __floordiv__ (self , other : int ) -> Self : ...
384
382
385
383
def __floordiv__ (self , other : int | timedelta ) -> int | Duration :
386
384
if not isinstance (other , (int , timedelta )):
@@ -389,7 +387,8 @@ def __floordiv__(self, other: int | timedelta) -> int | Duration:
389
387
usec = self ._to_microseconds ()
390
388
if isinstance (other , timedelta ):
391
389
return cast (
392
- int , usec // other ._to_microseconds () # type: ignore[attr-defined]
390
+ int ,
391
+ usec // other ._to_microseconds (), # type: ignore[attr-defined]
393
392
)
394
393
395
394
if isinstance (other , int ):
@@ -402,12 +401,10 @@ def __floordiv__(self, other: int | timedelta) -> int | Duration:
402
401
)
403
402
404
403
@overload
405
- def __truediv__ (self , other : timedelta ) -> float :
406
- ...
404
+ def __truediv__ (self , other : timedelta ) -> float : ...
407
405
408
406
@overload
409
- def __truediv__ (self , other : float ) -> Self :
410
- ...
407
+ def __truediv__ (self , other : float ) -> Self : ...
411
408
412
409
def __truediv__ (self , other : int | float | timedelta ) -> Self | float :
413
410
if not isinstance (other , (int , float , timedelta )):
@@ -416,7 +413,8 @@ def __truediv__(self, other: int | float | timedelta) -> Self | float:
416
413
usec = self ._to_microseconds ()
417
414
if isinstance (other , timedelta ):
418
415
return cast (
419
- float , usec / other ._to_microseconds () # type: ignore[attr-defined]
416
+ float ,
417
+ usec / other ._to_microseconds (), # type: ignore[attr-defined]
420
418
)
421
419
422
420
if isinstance (other , int ):
@@ -443,7 +441,7 @@ def __truediv__(self, other: int | float | timedelta) -> Self | float:
443
441
444
442
def __mod__ (self , other : timedelta ) -> Self :
445
443
if isinstance (other , timedelta ):
446
- r = self ._to_microseconds () % other ._to_microseconds () # type: ignore[attr-defined] # noqa: E501
444
+ r = self ._to_microseconds () % other ._to_microseconds () # type: ignore[attr-defined]
447
445
448
446
return self .__class__ (0 , 0 , r )
449
447
0 commit comments