From 1ebcc1d11f1991d1f5c08db220515b132e08805c Mon Sep 17 00:00:00 2001 From: Semyon Proshev Date: Thu, 25 May 2017 17:33:50 +0300 Subject: [PATCH] Add `timespec` parameter to `datetime.datetime.isoformat` for Python 3.6+. (#1349) --- stdlib/3/datetime.pyi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/stdlib/3/datetime.pyi b/stdlib/3/datetime.pyi index 527867da8..8b1b2e45a 100644 --- a/stdlib/3/datetime.pyi +++ b/stdlib/3/datetime.pyi @@ -1,3 +1,4 @@ +import sys from typing import Optional, SupportsAbs, Tuple, overload MINYEAR = 0 @@ -198,7 +199,10 @@ class datetime: Optional[_tzinfo] = None) -> datetime: ... def astimezone(self, tz: Optional[_tzinfo] = ...) -> datetime: ... def ctime(self) -> str: ... - def isoformat(self, sep: str = ...) -> str: ... + if sys.version_info >= (3, 6): + def isoformat(self, sep: str = ..., timespec: str = ...) -> str: ... + else: + def isoformat(self, sep: str = ...) -> str: ... @classmethod def strptime(cls, date_string: str, format: str) -> datetime: ... def utcoffset(self) -> Optional[timedelta]: ...