[Python-ideas] Allow parentheses to be used with "with" block

Neil Girdhar mistersheik at gmail.com
Mon Feb 16 06:40:41 CET 2015


Personally, I would rather wait for a day far away when Python removes the 
LL(1) grammar restriction than introduce weird new syntax.  Maybe when the 
reference standard Python is written in Python and Python has a good parser 
module.  With backtracking, it should be fine and unambiguous.

Best,

Neil

On Monday, February 16, 2015 at 12:33:23 AM UTC-5, Greg Ewing 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'. 
>
> -- 
> Greg 
> _______________________________________________ 
> Python-ideas mailing list 
> Python... at python.org <javascript:> 
> https://mail.python.org/mailman/listinfo/python-ideas 
> Code of Conduct: http://python.org/psf/codeofconduct/ 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150215/435f50bd/attachment.html>


More information about the Python-ideas mailing list