> Currently, Python allows catching all exceptions with a bare except: clause, which can lead to overly broad exception handling and mask important errors.
The fact that this pattern catches NameError and other things which are obviously design errors means that it is a really bad behavior which is unfortunately common.
Of course, many folks in this comment section and the PEP discussion thread point out the pitfalls with the suggested remedies. It would be great if some amount of linting/warning/static check could be devised to help people uncover the problem though.
The fact that this pattern catches NameError and other things which are obviously design errors means that it is a really bad behavior which is unfortunately common.
Of course, many folks in this comment section and the PEP discussion thread point out the pitfalls with the suggested remedies. It would be great if some amount of linting/warning/static check could be devised to help people uncover the problem though.