[issue14260] re.groupindex available for modification and continues to work, having incorrect data inside it

Matthew Barnett report at bugs.python.org
Mon Mar 12 19:16:41 CET 2012


Matthew Barnett <python at mrabarnett.plus.com> added the comment:

The re module creates the dict purely for the benefit of the user, and as it's a normal dict, it's mutable.

An alternative would to use an immutable dict or dict-like object, but Python doesn't have such a class, and it's probably not worth writing one just for this use-case.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14260>
_______________________________________


More information about the Python-bugs-list mailing list