It's hard to overstate how "normal" a non-match is. A typical program might
examine thousands of strings to identify the ten that match a pattern.
Exceptions shouldn't be used for cases that are in no way exceptional.

On Sun, Oct 22, 2023, 7:27 PM Greg Ewing <gcew...@snap.net.nz> wrote:

> On 23/10/23 1:36 am, Juancarlo Añez wrote:
> > The *re* module is a black swan, because most of stdlib raises
> > exceptions on invalid arguments or not being able to deliver.
>
> Most of the time, failure to match an re is not a programming error.
> Often it's perfectly normal. Sometimes it's the result of invalid
> user input, but that's the fault of the user, not the programmer.
>
> --
> Greg
> _______________________________________________
> 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/4JNKSUTZ6ZDVHERYCNO35J2UDS5UO4CD/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
_______________________________________________
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/ATA4NWRU4MNUX427LZLNP3UMRVEOLVQE/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to