Vladimir

65%
Flag icon
Using @contextmanager reduces the boilerplate of creating a context manager: instead of writing a whole class with __enter__/__exit__ methods, you just implement a generator with a single yield that should produce whatever you want the __enter__ method to return.
Fluent Python: Clear, Concise, and Effective Programming
Rate this book
Clear rating
Open Preview