
Mathias Panzenböck schrieb:
Indeed, but the constructions we talk about would allow nesting dozens of context managers without any problem ; Well then, you'll ask me "what kind of a perverse would need to imbricate dozens of context managers ???" ; sincerely I don't know ^^
But since "flat is better than nested", even just for 2 or 3 context managers, I feel a construct like "with A() as a, B() as b, C() as c:" is anyway better than 3 nested with statements
Yes I'm +1 for "with A() as a, B() as b, C() as c:", too. For the deleyedNested(...) thing I'm -1 however.
I'm also +1 (explicitly on this syntax variant, not "with A(),B() as a,b", since it seems a more logical step from the nested with statements). Mattias and I have a patch in working; I expect it will be fine to amend PEP 343 for this when it's ready. Georg