After reading Chris McDonough’s What Not To Do When Writing Python Software, it occurred to me that many people don’t actually know how to properly re-raise exceptions. So a little mini-tutorial for Python programmers, about exceptions…
First, this is bad:
try: some_code() except: revert_stuff() raise Exception("some_code failed …