23.05.21 12:42, Shivam Saini пише:
>     except:
>         pass

Don't do this. Never write a bare except handler which does not re-raise
an exception. There are few exceptions of this rule, but it is unlikely
that you will see them in first years of your practice. It is an
anti-pattern, and a feature that facilitates its use will never be added.

Always specify exceptions which you expect to catch. If you want to look
cool, you can use contextlib.suppress(), although it can make further
refactoring more difficult.

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

Reply via email to