3 ms·
It's not that straightforward to create your own context manager, and creating a correct generic wrapper for the use case of composing multiple context managers
by masklinn 14y ago
It's not that straightforward to create your own context manager, and creating a correct generic wrapper for the use case of composing multiple context managers is even harder (as demonstrated by the woes of contextlib.nested).
And if you're going to create a custom "composed" context manager every single time, you're probably better off just nesting `with` statements.