@@ -63,24 +63,16 @@ class relativedelta:
63
63
@weeks .setter
64
64
def weeks (self , value : int ) -> None : ...
65
65
def normalized (self ) -> Self : ...
66
- # TODO: use Union when mypy will handle it properly in overloaded operator
67
- # methods (#2129, #1442, #1264 in mypy)
68
66
@overload
69
- def __add__ (self , other : relativedelta ) -> Self : ...
70
- @overload
71
- def __add__ (self , other : timedelta ) -> Self : ...
67
+ def __add__ (self , other : timedelta | relativedelta ) -> Self : ...
72
68
@overload
73
69
def __add__ (self , other : _DateT ) -> _DateT : ...
74
70
@overload
75
- def __radd__ (self , other : relativedelta ) -> Self : ...
76
- @overload
77
- def __radd__ (self , other : timedelta ) -> Self : ...
71
+ def __radd__ (self , other : timedelta | relativedelta ) -> Self : ...
78
72
@overload
79
73
def __radd__ (self , other : _DateT ) -> _DateT : ...
80
74
@overload
81
- def __rsub__ (self , other : relativedelta ) -> Self : ...
82
- @overload
83
- def __rsub__ (self , other : timedelta ) -> Self : ...
75
+ def __rsub__ (self , other : timedelta | relativedelta ) -> Self : ...
84
76
@overload
85
77
def __rsub__ (self , other : _DateT ) -> _DateT : ...
86
78
def __sub__ (self , other : relativedelta ) -> Self : ...
0 commit comments