Skip to content

Commit

Permalink
Use union instead of overloads in dateutil (#13184)
Browse files Browse the repository at this point in the history
  • Loading branch information
kbaikov authored Dec 5, 2024
1 parent 6b98467 commit 633a4d7
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions stubs/python-dateutil/dateutil/relativedelta.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,16 @@ class relativedelta:
@weeks.setter
def weeks(self, value: int) -> None: ...
def normalized(self) -> Self: ...
# TODO: use Union when mypy will handle it properly in overloaded operator
# methods (#2129, #1442, #1264 in mypy)
@overload
def __add__(self, other: relativedelta) -> Self: ...
@overload
def __add__(self, other: timedelta) -> Self: ...
def __add__(self, other: timedelta | relativedelta) -> Self: ...
@overload
def __add__(self, other: _DateT) -> _DateT: ...
@overload
def __radd__(self, other: relativedelta) -> Self: ...
@overload
def __radd__(self, other: timedelta) -> Self: ...
def __radd__(self, other: timedelta | relativedelta) -> Self: ...
@overload
def __radd__(self, other: _DateT) -> _DateT: ...
@overload
def __rsub__(self, other: relativedelta) -> Self: ...
@overload
def __rsub__(self, other: timedelta) -> Self: ...
def __rsub__(self, other: timedelta | relativedelta) -> Self: ...
@overload
def __rsub__(self, other: _DateT) -> _DateT: ...
def __sub__(self, other: relativedelta) -> Self: ...
Expand Down

0 comments on commit 633a4d7

Please sign in to comment.