Add date.__radd__ and datetime.__radd__ (#3539)

Fixes #3538
This commit is contained in:
Ophir LOJKINE
2019-12-12 18:38:51 +01:00
committed by Sebastian Rittau
parent a06abc5dff
commit fda384fe0a

View File

@@ -72,8 +72,10 @@ class date:
def __gt__(self, other: date) -> bool: ...
if sys.version_info >= (3, 8):
def __add__(self: _S, other: timedelta) -> _S: ...
def __radd__(self: _S, other: timedelta) -> _S: ...
else:
def __add__(self, other: timedelta) -> date: ...
def __radd__(self, other: timedelta) -> date: ...
@overload
def __sub__(self, other: timedelta) -> date: ...
@overload
@@ -299,8 +301,10 @@ class datetime(date):
def __gt__(self, other: datetime) -> bool: ... # type: ignore
if sys.version_info >= (3, 8):
def __add__(self: _S, other: timedelta) -> _S: ...
def __radd__(self: _S, other: timedelta) -> _S: ...
else:
def __add__(self, other: timedelta) -> datetime: ...
def __radd__(self, other: timedelta) -> datetime: ...
@overload # type: ignore
def __sub__(self, other: datetime) -> timedelta: ...
@overload