https://github.com/python/cpython/commit/8b4e7f8ec0be2bb0443c0d2394bb03cc61c4eb06
commit: 8b4e7f8ec0be2bb0443c0d2394bb03cc61c4eb06
branch: 3.12
author: Miss Islington (bot) <[email protected]>
committer: cfbolz <[email protected]>
date: 2024-12-10T09:20:54+01:00
summary:

[3.12] gh-127552: Remove comment questioning 4-digit restriction for ‘Y’ in 
datetime.strptime patterns (GH-127590) (#127649)

gh-127552: Remove comment questioning 4-digit restriction for ‘Y’ in 
datetime.strptime patterns (GH-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).
(cherry picked from commit 51cfa569e379f84b3418db0971a71b1ef575a42b)

Co-authored-by: Beomsoo Kim <[email protected]>
Co-authored-by: Bénédikt Tran <[email protected]>

files:
M Lib/_strptime.py

diff --git a/Lib/_strptime.py b/Lib/_strptime.py
index dfd2bc5d8b4af5..5d9df2b12f8dda 100644
--- a/Lib/_strptime.py
+++ b/Lib/_strptime.py
@@ -300,8 +300,6 @@ def __init__(self, locale_time=None):
             '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'),

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to