diff --git a/stdlib/2and3/datetime.pyi b/stdlib/2and3/datetime.pyi index ea742b9cedd6..367b2a0d0014 100644 --- a/stdlib/2and3/datetime.pyi +++ b/stdlib/2and3/datetime.pyi @@ -93,6 +93,9 @@ class time: def microsecond(self) -> int: ... @property def tzinfo(self) -> Optional[_tzinfo]: ... + if sys.version_info >= (3, 6): + @property + def fold(self) -> int: ... def __le__(self, other: time) -> bool: ... def __lt__(self, other: time) -> bool: ... @@ -108,8 +111,13 @@ class time: def utcoffset(self) -> Optional[timedelta]: ... def tzname(self) -> Optional[str]: ... def dst(self) -> Optional[int]: ... - def replace(self, hour: int = ..., minute: int = ..., second: int = ..., - microsecond: int = ..., tzinfo: Optional[_tzinfo] = ...) -> time: ... + if sys.version_info >= (3, 6): + def replace(self, hour: int = ..., minute: int = ..., second: int = ..., + microsecond: int = ..., tzinfo: Optional[_tzinfo] = ..., + *, fold: int = ...) -> time: ... + else: + def replace(self, hour: int = ..., minute: int = ..., second: int = ..., + microsecond: int = ..., tzinfo: Optional[_tzinfo] = ...) -> time: ... _date = date _time = time @@ -168,9 +176,14 @@ class datetime: max: ClassVar[datetime] resolution: ClassVar[timedelta] - def __init__(self, year: int, month: int, day: int, hour: int = ..., - minute: int = ..., second: int = ..., microsecond: int = ..., - tzinfo: Optional[tzinfo] = ...) -> None: ... + if sys.version_info >= (3, 6): + def __init__(self, year: int, month: int, day: int, hour: int = ..., + minute: int = ..., second: int = ..., microsecond: int = ..., + tzinfo: Optional[tzinfo] = ..., *, fold: int = ...) -> None: ... + else: + def __init__(self, year: int, month: int, day: int, hour: int = ..., + minute: int = ..., second: int = ..., microsecond: int = ..., + tzinfo: Optional[tzinfo] = ...) -> None: ... @property def year(self) -> int: ... @@ -188,6 +201,9 @@ class datetime: def microsecond(self) -> int: ... @property def tzinfo(self) -> Optional[_tzinfo]: ... + if sys.version_info >= (3, 6): + @property + def fold(self) -> int: ... @classmethod def fromtimestamp(cls, t: float, tz: Optional[_tzinfo] = ...) -> datetime: ... @@ -201,8 +217,12 @@ class datetime: def now(cls, tz: Optional[_tzinfo] = ...) -> datetime: ... @classmethod def utcnow(cls) -> datetime: ... - @classmethod - def combine(cls, date: date, time: time) -> datetime: ... + if sys.version_info >= (3, 6): + @classmethod + def combine(cls, date: date, time: time, tzinfo: Optional[_tzinfo] = ...) -> datetime: ... + else: + @classmethod + def combine(cls, date: date, time: time) -> datetime: ... def strftime(self, fmt: _Text) -> str: ... if sys.version_info >= (3,): def __format__(self, fmt: str) -> str: ... @@ -216,9 +236,14 @@ class datetime: def date(self) -> _date: ... def time(self) -> _time: ... def timetz(self) -> _time: ... - def replace(self, year: int = ..., month: int = ..., day: int = ..., hour: int = ..., - minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo: - Optional[_tzinfo] = ...) -> datetime: ... + if sys.version_info >= (3, 6): + def replace(self, year: int = ..., month: int = ..., day: int = ..., hour: int = ..., + minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo: + Optional[_tzinfo] = ..., *, fold: int = ...) -> datetime: ... + else: + def replace(self, year: int = ..., month: int = ..., day: int = ..., hour: int = ..., + minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo: + Optional[_tzinfo] = ...) -> datetime: ... if sys.version_info >= (3, 3): def astimezone(self, tz: Optional[_tzinfo] = ...) -> datetime: ... else: