3 ms·
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
by setopt 2y 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).
- linsomniac 2y agoWith that PEP you can still do a quick "try: except:" it's just spelled "try: except Exception:"
- dataflow 2y ago> warning every time an unspecific exception is caught Caught and not re-raised