[Python-ideas] Allow parentheses to be used with "with" block
Andrew Barnert
abarnert at yahoo.com
Mon Feb 16 07:31:10 CET 2015
On Feb 15, 2015, at 21:32, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> I *think* this is unambiguous:
>
> with a as b and c as d and e as f:
> ...
>
> because the rule for a with statement is
>
> with_stmt: 'with' with_item (',' with_item)* ':' suite
> with_item: test ['as' expr]
>
> and expr doesn't include 'and'.
How could expr not include and?
But... Isn't a with target a target, not an expr? (And, if not, shouldn't it be?) And targets don't include and. So this still works.
But how does it help? Where can you add parens, or otherwise solve the continuation issue, with and that you couldn't with commas?
More information about the Python-ideas
mailing list