Python Developer — Hard
Key points
- `contextlib.contextmanager` enables creating context managers with generator functions
- `yield` separates __enter__ and __exit__ code
- Exceptions from the with block are handled at the yield point
Ready to go further?
Related questions
