[issue40984] re.compile's repr truncates patterns at 200 characters

Quentin Wenger report at bugs.python.org
Tue Jun 16 06:26:05 EDT 2020


Quentin Wenger <wenger.quentin at bluewin.ch> added the comment:

All in all, it is simply a matter of compliance. The doc of repr says that a repr is either

- a string that can be eval()'ed back to (an equivalent of) the original object
- or a "more loose" angle-bracket representation.

re.compile with small patterns falls in the first category. The other bug report corresponds to the second one, no problem.

However, re.compile with large patterns doesn't fall in either category, nor would it if changed to use an ellipsis.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40984>
_______________________________________


More information about the Python-bugs-list mailing list