Last active
August 27, 2019 17:53
-
-
Save brydavis/6e67ee55da925787de7969c78414ea43 to your computer and use it in GitHub Desktop.
Examples creating and using custom context managers in Python
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note that in the
__exit__method using the class way:exit_typeis the exit typeexit_valis the exit valueexit_tbis the exit tracebackTry printed them out if you want to see what they look like.