1 from datetime import date, datetime, timedelta
2 from typing import SupportsFloat, TypeVar, overload
4 from ._common import weekday
6 _SelfT = TypeVar("_SelfT", bound=relativedelta)
7 _DateT = TypeVar("_DateT", date, datetime)
8 # Work around attribute and type having the same name.
19 class relativedelta(object):
30 weekday: _weekday | None
35 microsecond: int | None
38 dt1: date | None = ...,
39 dt2: date | None = ...,
40 years: int | None = ...,
41 months: int | None = ...,
42 days: int | None = ...,
43 leapdays: int | None = ...,
44 weeks: int | None = ...,
45 hours: int | None = ...,
46 minutes: int | None = ...,
47 seconds: int | None = ...,
48 microseconds: int | None = ...,
49 year: int | None = ...,
50 month: int | None = ...,
51 day: int | None = ...,
52 weekday: int | _weekday | None = ...,
53 yearday: int | None = ...,
54 nlyearday: int | None = ...,
55 hour: int | None = ...,
56 minute: int | None = ...,
57 second: int | None = ...,
58 microsecond: int | None = ...,
61 def weeks(self) -> int: ...
63 def weeks(self, value: int) -> None: ...
64 def normalized(self: _SelfT) -> _SelfT: ...
65 # TODO: use Union when mypy will handle it properly in overloaded operator
66 # methods (#2129, #1442, #1264 in mypy)
68 def __add__(self: _SelfT, other: relativedelta) -> _SelfT: ...
70 def __add__(self: _SelfT, other: timedelta) -> _SelfT: ...
72 def __add__(self, other: _DateT) -> _DateT: ...
74 def __radd__(self: _SelfT, other: relativedelta) -> _SelfT: ...
76 def __radd__(self: _SelfT, other: timedelta) -> _SelfT: ...
78 def __radd__(self, other: _DateT) -> _DateT: ...
80 def __rsub__(self: _SelfT, other: relativedelta) -> _SelfT: ...
82 def __rsub__(self: _SelfT, other: timedelta) -> _SelfT: ...
84 def __rsub__(self, other: _DateT) -> _DateT: ...
85 def __sub__(self: _SelfT, other: relativedelta) -> _SelfT: ...
86 def __neg__(self: _SelfT) -> _SelfT: ...
87 def __bool__(self) -> bool: ...
88 def __nonzero__(self) -> bool: ...
89 def __mul__(self: _SelfT, other: SupportsFloat) -> _SelfT: ...
90 def __rmul__(self: _SelfT, other: SupportsFloat) -> _SelfT: ...
91 def __eq__(self, other: object) -> bool: ...
92 def __ne__(self, other: object) -> bool: ...
93 def __div__(self: _SelfT, other: SupportsFloat) -> _SelfT: ...
94 def __truediv__(self: _SelfT, other: SupportsFloat) -> _SelfT: ...
95 def __repr__(self) -> str: ...
96 def __abs__(self: _SelfT) -> _SelfT: ...
97 def __hash__(self) -> int: ...