Hacker News new | ask | show | jobs
by setopt 621 days ago
I think emitting a warning every time an unspecific exception is caught might be a better balance. That way, you could still do a quick “try: … except: …” when drafting new code, but the code might warn you if the bare except block is ever used (including what exception was caught, and a suggestion for how to catch only that specific exception).
2 comments

With that PEP you can still do a quick "try: except:" it's just spelled "try: except Exception:"
> warning every time an unspecific exception is caught

Caught and not re-raised