Skip to content

Commit

Permalink
[3.12] pythongh-127552: Remove comment questioning 4-digit restrictio…
Browse files Browse the repository at this point in the history
…n for ‘Y’ in datetime.strptime patterns (pythonGH-127590) (python#127649)

pythongh-127552: Remove comment questioning 4-digit restriction for ‘Y’ in datetime.strptime patterns (pythonGH-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 51cfa56)

Co-authored-by: Beomsoo Kim <beoms424@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 10, 2024
1 parent e881dd1 commit 8b4e7f8
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions Lib/_strptime.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down

0 comments on commit 8b4e7f8

Please sign in to comment.