mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 20:24:30 +08:00
Use union instead of overloads in dateutil (#13184)
This commit is contained in:
committed by
GitHub
parent
6b98467337
commit
633a4d73f2
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user