
April 27, 2009
9:54 p.m.
On 27 Apr 2009, at 20:33, Mattias Brändström wrote:
[...]
It would be really useful to have a shorthand for creating truly nested with statements. My idea then is this: couldn't the language be tweaked to handle this? It might look something like this:
with A(), B() as a,b: # Code that uses a and b.
This would translate directly to:
with A() as a: with B() as b: # Code that uses a and b.
There was a discussion about this on this list: http://mail.python.org/pipermail/python-ideas/2009-March/003188.html I can't remember the outcome. -- Arnaud