Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Docstring edit
  • Loading branch information
zuo committed Oct 1, 2024
commit 195666217a8172b7de7906ef8b9b9e88d2f30f9f
13 changes: 7 additions & 6 deletions Lib/_strptime.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,15 @@ def __pattern_with_lax_year(self, format):

Necessary to ensure that strptime() is able to parse strftime()'s
output when %c or %x is used -- considering that for some locales
and platforms (e.g., 'C.UTF-8' on Linux), formatting with either
%c or %x may produce a year number representation that is shorter
than the usual four or two digits, if the number is small enough
(e.g., '999' rather than `0999', or '9' rather than of '09').
and platforms (e.g., 'C.UTF-8' on Linux) formatting with either
%c or %x may produce a year number representation which is *not*
zero-padded and, consequently (if the number is small enough),
shorter than the usual four or two digits (e.g., '999' rather
than `0999', or '9' rather than of '09').

Note that this helper is intended to be used to prepare regex
patterns only for the `%c` and `%x` format codes (and *not* for
`%y`, `%Y` or `%G`).
patterns *only* for the `%c` and `%x` format codes (and *not*
for `%y`, `%Y` or `%G`).

"""
pattern = self.pattern(format)
Expand Down