return or break statement in a finally block
Hello. What do you think, is the following a wat?
https://docs.python.org/3/reference/compound_stmts.html#the-try-statement:
If an exception occurs in any of the clauses and is not handled, the exception is temporarily saved. ... If the finally clause executes a return or break statement, the saved exception is discarded.
Example:
while True: try: 1/0 except Exception: raise finally: break # discards the exception print('hell') # it does print indeed