by BurningFrog · 2y ago · 0 comments
To me, "if anything goes wrong, do the following" is perfectly valid semantics that appears a lot, and a bare excepts is a fine way to implement that.
I think what confuses these discussions is that a common "rookie mistake" is slapping on a bare except when you really should be specific.
For some people, this is reason enough to blindly enforce a "bare excepts" rule. To me, the costs vastly outweigh the benefits in this case.
At it's core, this might be a personality type issue more than anything else.
I still don't like the proposed change because of how much existing code it would break, but if we're designing a new language I approve.
I’m not much of a python programmer but my experience with the language would make me tend to agree actually. There are bigger fish to fry and so the effort to go after this relatively tiny sardine is perhaps not worth it.
The point of the pep is that it should be explicit, especially because the short form doesn't show whether catching terminating exceptions is a bug or intentional