[issue31969] re.groups() is not checking the arguments

Serhiy Storchaka report at bugs.python.org
Wed Nov 8 03:46:10 EST 2017


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

No, it should not throw error that there is no any optional match.

It is not easy to check if there is optional match. For example, the pattern '(a)|(b)' contains optional matches, while the group in the pattern '()?' always matches.

----------

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


More information about the Python-bugs-list mailing list