Skip to content

Instantly share code, notes, and snippets.

@PharaohKJ
Created October 16, 2020 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PharaohKJ/8d7928096b42ab6181ba18fceba19fdb to your computer and use it in GitHub Desktop.
Save PharaohKJ/8d7928096b42ab6181ba18fceba19fdb to your computer and use it in GitHub Desktop.
from contextlib import contextmanager
@contextmanager
def context():
print("enter")
try:
print("try")
yield
except Exception as e:
print("except")
raise e
else:
print("else")
finally:
print("finally")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment