]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-127552: Remove comment questioning 4-digit restriction for ‘Y’ in datetime.strptim...
authorBeomsoo Kim <beoms424@gmail.com>
Wed, 4 Dec 2024 18:30:51 +0000 (03:30 +0900)
committerGitHub <noreply@github.com>
Wed, 4 Dec 2024 18:30:51 +0000 (10:30 -0800)
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).

Lib/_strptime.py

index 5f4d2475c0169bc0da35b1ab82ed67499eef423a..e6e23596db6f998e0f231818bad0ada34602b8b1 100644 (file)
@@ -301,8 +301,6 @@ class TimeRE(dict):
             'V': r"(?P<V>5[0-3]|0[1-9]|[1-4]\d|\d)",
             # W is set below by using 'U'
             'y': r"(?P<y>\d\d)",
-            #XXX: Does 'Y' need to worry about having less or more than
-            #     4 digits?
             'Y': r"(?P<Y>\d\d\d\d)",
             'z': r"(?P<z>[+-]\d\d:?[0-5]\d(:?[0-5]\d(\.\d{1,6})?)?|(?-i:Z))",
             'A': self.__seqToRE(self.locale_time.f_weekday, 'A'),