On 10/21/2023 8:31 PM, Chris Angelico wrote:
On Sun, 22 Oct 2023 at 11:29, MRAB<pyt...@mrabarnett.plus.com> wrote:
I think what the OP wants is to have re.match either return a match or
raise an exception.
Yes, and my point is that simply attempting to access an attribute
will do exactly that. It's not a silent failure.
Why create a new argument, then mandate that you use it everywhere,
just to achieve what's already happening?
Because the end user message would be much better, and the exception
would point to the exact line where the match didn't occur, instead of
some subsequent line.
Eric
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/python-ideas@python.org/message/5HRZYV54IUK43VX5WRULEZ6CH3IP35OO/
Code of Conduct: http://python.org/psf/codeofconduct/