From fda384fe0a2d0eaecc7c7ccaffdf4f6a401adcd7 Mon Sep 17 00:00:00 2001 From: Ophir LOJKINE Date: Thu, 12 Dec 2019 18:38:51 +0100 Subject: [PATCH] Add date.__radd__ and datetime.__radd__ (#3539) Fixes #3538 --- stdlib/2and3/datetime.pyi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stdlib/2and3/datetime.pyi b/stdlib/2and3/datetime.pyi index a721cb765..9c4031ad5 100644 --- a/stdlib/2and3/datetime.pyi +++ b/stdlib/2and3/datetime.pyi @@ -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