Python Tip #293 (of 365): Write context managers with contextlib.contextmanager....
Trey Hunner ๐ @treyhunner@mastodon.social
Python Tip #293 (of 365):
Write context managers with contextlib.contextmanager.
Instead of making a class with __enter__ and __exit__ methods, we can make a context manager out of a function:
๐งต (1/4)