1 from typing import overload, Any, List, Optional, SupportsFloat, TypeVar, Union
\r
2 from datetime import date, datetime, timedelta
\r
4 from ._common import weekday
\r
7 _SelfT = TypeVar('_SelfT', bound=relativedelta)
\r
8 _DateT = TypeVar('_DateT', date, datetime)
\r
10 MO = ... # type: weekday
\r
11 TU = ... # type: weekday
\r
12 WE = ... # type: weekday
\r
13 TH = ... # type: weekday
\r
14 FR = ... # type: weekday
\r
15 SA = ... # type: weekday
\r
16 SU = ... # type: weekday
\r
19 class relativedelta(object):
\r
21 dt1: Optional[date]=...,
\r
22 dt2: Optional[date]=...,
\r
23 years: Optional[int]=..., months: Optional[int]=...,
\r
24 days: Optional[int]=..., leapdays: Optional[int]=...,
\r
25 weeks: Optional[int]=...,
\r
26 hours: Optional[int]=..., minutes: Optional[int]=...,
\r
27 seconds: Optional[int]=..., microseconds: Optional[int]=...,
\r
28 year: Optional[int]=..., month: Optional[int]=...,
\r
29 day: Optional[int]=...,
\r
30 weekday: Optional[Union[int, weekday]]=...,
\r
31 yearday: Optional[int]=...,
\r
32 nlyearday: Optional[int]=...,
\r
33 hour: Optional[int]=..., minute: Optional[int]=...,
\r
34 second: Optional[int]=...,
\r
35 microsecond: Optional[int]=...) -> None: ...
\r
37 def weeks(self) -> int: ...
\r
39 def weeks(self, value: int) -> None: ...
\r
40 def normalized(self: _SelfT) -> _SelfT: ...
\r
41 # TODO: use Union when mypy will handle it properly in overloaded operator
\r
42 # methods (#2129, #1442, #1264 in mypy)
\r
44 def __add__(self: _SelfT, other: relativedelta) -> _SelfT: ...
\r
46 def __add__(self: _SelfT, other: timedelta) -> _SelfT: ...
\r
48 def __add__(self, other: _DateT) -> _DateT: ...
\r
50 def __radd__(self: _SelfT, other: relativedelta) -> _SelfT: ...
\r
52 def __radd__(self: _SelfT, other: timedelta) -> _SelfT: ...
\r
54 def __radd__(self, other: _DateT) -> _DateT: ...
\r
56 def __rsub__(self: _SelfT, other: relativedelta) -> _SelfT: ...
\r
58 def __rsub__(self: _SelfT, other: timedelta) -> _SelfT: ...
\r
60 def __rsub__(self, other: _DateT) -> _DateT: ...
\r
61 def __sub__(self: _SelfT, other: relativedelta) -> _SelfT: ...
\r
62 def __neg__(self: _SelfT) -> _SelfT: ...
\r
63 def __bool__(self) -> bool: ...
\r
64 def __nonzero__(self) -> bool: ...
\r
65 def __mul__(self: _SelfT, other: SupportsFloat) -> _SelfT: ...
\r
66 def __rmul__(self: _SelfT, other: SupportsFloat) -> _SelfT: ...
\r
67 def __eq__(self, other) -> bool: ...
\r
68 def __ne__(self, other: object) -> bool: ...
\r
69 def __div__(self: _SelfT, other: SupportsFloat) -> _SelfT: ...
\r
70 def __truediv__(self: _SelfT, other: SupportsFloat) -> _SelfT: ...
\r
71 def __repr__(self) -> str: ...
\r