[issue14260] regex.groupindex available for modification and continues to work, having incorrect data inside it
py.user
report at bugs.python.org
Mon Mar 12 06:28:23 CET 2012
New submission from py.user <port139 at yandex.ru>:
>>> import re
>>> p = re.compile(r'abc(?P<n>def)')
>>> p.sub(r'\g<n>', 'abcdef123abcdef')
'def123def'
>>> p.groupindex['n'] = 2
>>> p.sub(r'\g<n>', 'abcdef123abcdef')
'def123def'
>>> p.groupindex
{'n': 2}
>>>
----------
components: Regular Expressions
messages: 155442
nosy: ezio.melotti, mrabarnett, py.user
priority: normal
severity: normal
status: open
title: regex.groupindex available for modification and continues to work, having incorrect data inside it
type: behavior
versions: Python 3.2
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14260>
_______________________________________
More information about the Python-bugs-list
mailing list