Created
February 1, 2018 10:14
-
-
Save goyalrohit/ed9ae3126418db9728e29ab2d2509c24 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LoggingContextManager: | |
def __enter__(self): | |
print('LoggingContextManager.__enter__()') | |
return "You are in a with block" | |
def __exit__(self, exc_type, exc_val, exc_tb): | |
print('LoggingContextManager.__exit__({},{},{})'.format(exc_type, exc_val, exc_tb)) | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment