
March 30, 2020
3:18 p.m.
31.03.20 00:27, Jimmy Thrasibule пише:
In my situation, I would like to mix the `with` statement with `else`. In this case I would like that if no exception is raised within the `with` to run the `else` part.
It is easy. You do not need "else". with my_context(): do_something_sensitive() print("We're all safe.")