From: Beomsoo Kim Date: Wed, 4 Dec 2024 18:30:51 +0000 (+0900) Subject: gh-127552: Remove comment questioning 4-digit restriction for ‘Y’ in datetime.strptim... X-Git-Tag: v3.14.0a3~124 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=51cfa569e379f84b3418db0971a71b1ef575a42b;p=thirdparty%2FPython%2Fcpython.git gh-127552: Remove comment questioning 4-digit restriction for ‘Y’ in datetime.strptime patterns (#127590) The code has required 4 digits for the year since its inclusion in the stdlib in 2002 (over 22 years ago as of this commit). --- diff --git a/Lib/_strptime.py b/Lib/_strptime.py index 5f4d2475c016..e6e23596db6f 100644 --- a/Lib/_strptime.py +++ b/Lib/_strptime.py @@ -301,8 +301,6 @@ class TimeRE(dict): 'V': r"(?P5[0-3]|0[1-9]|[1-4]\d|\d)", # W is set below by using 'U' 'y': r"(?P\d\d)", - #XXX: Does 'Y' need to worry about having less or more than - # 4 digits? 'Y': r"(?P\d\d\d\d)", 'z': r"(?P[+-]\d\d:?[0-5]\d(:?[0-5]\d(\.\d{1,6})?)?|(?-i:Z))", 'A': self.__seqToRE(self.locale_time.f_weekday, 'A'),