Skip to content

Commit 3862b33

Browse files
committed
Update comment
1 parent c43ec46 commit 3862b33

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎Lib/string.py‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ class Template(metaclass=_TemplateMetaclass):
8181
delimiter = '$'
8282
idpattern = r'[_a-z][_a-z0-9]*'
8383
braceidpattern = None
84+
85+
# We use re.I | re.A while compiling Template.idpattern in the metaclass
86+
# above, but since flags is part of the public API, we restore its original
87+
# documented value after class creation for backward compatibility.
8488
flags = _re.IGNORECASE | _re.ASCII
8589

8690
def __init__(self, template):
@@ -157,8 +161,7 @@ def convert(mo):
157161
return self.pattern.sub(convert, self.template)
158162

159163

160-
# We use re.I | re.A when compiling Template.idpattern, but restore old flag
161-
# for backward compatibility.
164+
# Restore old, documented flag. See Template.flags for detail.
162165
Template.flags = _re.IGNORECASE
163166

164167

0 commit comments

Comments
 (0)