On 08/12/2014 06:57 PM, Armin Rigo wrote:
Hi,
On 12 August 2014 01:08, Allen Li <cyberdupo56@gmail.com> wrote:
with (open('foo') as foo, open('bar') as bar, open('baz') as baz, open('spam') as spam, open('eggs') as eggs): pass
+1. It's exactly the same grammar extension as for "from import" statements, for the same reason.
Not the same: in import statements it unambiguously replaces a list of (optionally as-renamed) identifiers. Here, it would replace an arbitrary expression, which I think would mean that we couldn't differentiate between e.g. with (expr).meth(): # a line break in "expr" # would make the parens useful and with (expr1, expr2): cheers, Georg