duration.pyi 710 B

1234567891011121314151617181920212223242526272829
  1. import datetime
  2. import decimal
  3. from typing import overload
  4. class Duration:
  5. months: decimal.Decimal
  6. years: decimal.Decimal
  7. tdelta: datetime.timedelta
  8. def __init__(
  9. self,
  10. days: int,
  11. seconds: int,
  12. microseconds: int,
  13. milliseconds: int,
  14. minutes: int,
  15. hours: int,
  16. weeks: int,
  17. months: int | decimal.Decimal,
  18. years: int | decimal.Decimal,
  19. ) -> None: ...
  20. @overload
  21. def __add__(self, other: datetime.datetime) -> datetime.datetime: ...
  22. @overload
  23. def __add__(self, other: datetime.timedelta) -> Duration: ...
  24. @overload
  25. def __add__(self, other: Duration) -> Duration: ...
  26. __radd__ = __add__