mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-31672 - Add one last minor clarification for idpattern (#4483)
Add one last minor clarification for idpattern
This commit is contained in:
parent
337cbbace0
commit
e256b40888
2 changed files with 11 additions and 6 deletions
|
@ -79,11 +79,14 @@ class Template(metaclass=_TemplateMetaclass):
|
|||
"""A string class for supporting $-substitutions."""
|
||||
|
||||
delimiter = '$'
|
||||
# r'[a-z]' matches to non-ASCII letters when used with IGNORECASE,
|
||||
# but without ASCII flag. We can't add re.ASCII to flags because of
|
||||
# backward compatibility. So we use local -i flag and [a-zA-Z] pattern.
|
||||
# r'[a-z]' matches to non-ASCII letters when used with IGNORECASE, but
|
||||
# without the ASCII flag. We can't add re.ASCII to flags because of
|
||||
# backward compatibility. So we use the ?a local flag and [a-z] pattern.
|
||||
# We also can't remove the A-Z ranges, because although they are
|
||||
# technically redundant with the IGNORECASE flag, the value is part of the
|
||||
# publicly documented API.
|
||||
# See https://bugs.python.org/issue31672
|
||||
idpattern = r'(?-i:[_a-zA-Z][_a-zA-Z0-9]*)'
|
||||
idpattern = r'(?a:[_a-zA-Z][_a-zA-Z0-9]*)'
|
||||
braceidpattern = None
|
||||
flags = _re.IGNORECASE
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue