[docs] In re's named group the name cannot contain unicode characters (issue 14462)

ezio.melotti at gmail.com ezio.melotti at gmail.com
Sun Mar 10 20:57:04 CET 2013


The patch also needs a versionchanged in the docs to say that unicode
names are supported too.


http://bugs.python.org/review/14462/diff/7181/Lib/test/test_re.py
File Lib/test/test_re.py (right):

http://bugs.python.org/review/14462/diff/7181/Lib/test/test_re.py#newcode197
Lib/test/test_re.py:197:
re.compile('(?P<𝔘𝔫𝔦𝔠𝔬𝔡𝔢>x)(?P=𝔘𝔫𝔦𝔠𝔬𝔡𝔢)(?(𝔘𝔫𝔦𝔠𝔬𝔡𝔢)y)')
Writing non-BMP chars directly in the source is a bit risky -- some
editors might not deal well with it, and in the past we had bugs with
pyc files too.

http://bugs.python.org/review/14462/diff/7181/Lib/test/test_re.py#newcode198
Lib/test/test_re.py:198: self.assertRaises(re.error, re.compile,
'(?P<©>x)')
Maybe add a comment that mentions why this fails (or something like "#
check that valid identifiers works" at the top).

http://bugs.python.org/review/14462/diff/7181/Lib/test/test_re.py#newcode203
Lib/test/test_re.py:203: self.assertRaises(re.error, re.sub, '(?P<a>x)',
r'\g<©>', 'xx')
Do these tests cover all the cases you changed in re.py?

http://bugs.python.org/review/14462/


More information about the docs mailing list