PEP 760 – No More Bare Excepts

Weirdly, it’s a feature: What’s New In Python 3.8 — Python 3.13.0 documentation

A proposal to change that might have more success than this proposal did, though. Unlike bare except, I can’t recall encountering a situation where suppressing an exception via the finally clause instead of the except clause was the right thing to do.

It might have had something to do with supporting introspection on sys.exception (akin to the finally e: idea) as an alternative to using the regular exception catching clauses.

Or it might have just been a matter of “continue” originally being disallowed in the compiler because it didn’t work at the runtime implementation level (unlike “return” and “break”, which I believe have worked there since before Python 2.0), so addressing that was approached as a pure bug fix rather than revisiting the underlying language design question of whether or not it should work.

4 Likes