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

Neil Girdhar mistersheik at gmail.com
Mon Feb 16 10:58:26 CET 2015


I agree with that idea in general, but I do think that a with statement 
having parentheses would not be confusing for users to parse even though it 
would not be LL(1).

On Monday, February 16, 2015 at 4:53:05 AM UTC-5, Paul Moore wrote:
>
> On 16 February 2015 at 05:40, Neil Girdhar <miste... at gmail.com 
> <javascript:>> wrote: 
> > 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. 
>
> Note that the fact that the parser is LL(1) is a design feature rather 
> than a limitation. Guido has certainly in the past indicated that it's 
> a deliberate choice. The idea is that LL(1) grammars are not only 
> easier for compilers to parse but also for users to understand. 
>
> So the day you're waiting for is indeed likely to be far away :-) 
> Paul 
> _______________________________________________ 
> 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/20150216/e8ae3e81/attachment.html>


More information about the Python-ideas mailing list