You should be using contextlib in Python
- by Jaakko Moisio
- Nov. 28, 2020
Context managers are the preferred way to write readable and robust Python code that doesn’t leak resources. contextlib makes writing and using context managers a breeze. Check out some examples for productive use.