On 08/12/2014 06:57 PM, Armin Rigo wrote:
> Hi,
>
> On 12 August 2014 01:08, Allen Li <[email protected]> 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
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com