Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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).


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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: