An interesting discrepancy [1] has been noted when comparing
contextlib.nested (and contextlib.contextmanager) with the equivalent
nested with statements.
Specifically, the following examples behave differently if
cmB().__enter__() raises an exception which cmA().__exit__() then
handles (and
On Wed, Feb 25, 2009 at 04:24, Nick Coghlan ncogh...@gmail.com wrote:
An interesting discrepancy [1] has been noted when comparing
contextlib.nested (and contextlib.contextmanager) with the equivalent
nested with statements.
Specifically, the following examples behave differently if
On Wed, Feb 25, 2009 at 4:24 AM, Nick Coghlan ncogh...@gmail.com wrote:
An interesting discrepancy [1] has been noted when comparing
contextlib.nested (and contextlib.contextmanager) with the equivalent
nested with statements.
Specifically, the following examples behave differently if
Steven Bethard wrote:
If the problem is just the yield, can't this just be fixed by
implementing contextlib.nested() as a class rather than as a
@contextmanager decorated generator? Or is this a problem with class
based context managers too?
It's a problem for class-based context managers as