duration.pyi 759 B

12345678910111213141516171819202122232425262728293031
  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. ...
  21. @overload
  22. def __add__(self, other: datetime.datetime) -> datetime.datetime: ...
  23. @overload
  24. def __add__(self, other: datetime.timedelta) -> Duration: ...
  25. @overload
  26. def __add__(self, other: Duration) -> Duration: ...
  27. __radd__ = __add__