15 Mar
2009
15 Mar
'09
12:21 p.m.
Oh, your right! +1 for adding the new syntax. Nick Coghlan wrote:
I missed the discussion about potentially adding syntactic support for multiple context managers in the with statement, but figured I should mention a real limitation of contextlib.nested that *would* be fixed by adding dedicated syntactic support.
There's a genuine semantic difference between this:
with cmA(): with cmB(): # whatever
and this:
with nested(cmA(), cmB()): # whatever ...