Hey,

I bet this has been discussed before but I couldn't find it. I'd appreciate
it if anyone could point me to that thread.

I'm sick of seeing "AttributeError: 'NoneType' object has no attribute
'foo'" whenever there's a `re.match` operation that fails while the code
expects it to succeed. What do you think about a flag `require` such that
`re.match(pattern, string, require=True)` would either return a match or
raise an exception with an actually useful message?


Thanks,
Ram.
_______________________________________________
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/PLF46RTMGJUIXRPXPLHZUPLTLGE47TQA/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to