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
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_type
is the exit typeexit_val
is the exit valueexit_tb
is the exit tracebackTry printed them out if you want to see what they look like.