[issue22578] Add additional attributes to re.error

Matthew Barnett report at bugs.python.org
Thu Oct 9 01:01:42 CEST 2014


Matthew Barnett added the comment:

I prefer to include the line and column numbers if it's a multi-line pattern, not just if the line number is > 1.

BTW, it's shorter if you do this:

    self.colno = pos - pattern.rfind(newline, 0, pos)

If there's no newline, .rfind will return -1.

----------

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


More information about the Python-bugs-list mailing list