On 05/01/2020 02:19 AM, Steven D'Aprano wrote:

Best practice is to put try...except around only a *single* operation
which may raise what you want to catch. Of course that's easier said
than done, especially since nearly anything can raise nearly anything.

The follow-on to that is to only catch what you can recover from.

But in practice, it is surprisingly more practical than it sounds in
theory.

Since not every problem can be recovered from and therefore shouldn't be caught.

--
~Ethan~
_______________________________________________
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/6ZCLS3X6BTHVFR5FRZAMT573GQLSLI6W/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to