Created
January 19, 2019 12:36
-
-
Save h3xh4wk/245f9ec02aac01ee1a8ae2d630ed2418 to your computer and use it in GitHub Desktop.
Own object following the context manager protocol
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
import threading | |
some_lock = threading.lock() | |
with some_lock: | |
# Do something |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment