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

Neil Girdhar mistersheik at gmail.com
Tue Feb 17 03:16:47 CET 2015


If you read through the rest of the messages, you'll see that it seems that
we can have parentheses in an LL(1) grammar.

Best,

Neil

On Mon, Feb 16, 2015 at 9:14 PM, Stephen J. Turnbull <stephen at xemacs.org>
wrote:

> Neil Girdhar writes:
>
>  > 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).
>
> In this case, purity beat practicality, because practicality beats
> purity on a higher level.
>
> On the lower level, sticking to a pure LL(1) grammar rules out some
> practical possibilities that some folks think are nice.  On the higher
> level, in theory we'd like Python to provide concise expressions for
> all constructs when human readers can handle the concise expression
> fluently, but in practice the LL(1) rule is simple to follow (at least
> for Python maintainers who actually hack the parser!)
>
> Unfortunately (?!) it also prevents a lot of bike-shedding fun.<wink />
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150216/3bfcdac2/attachment-0001.html>


More information about the Python-ideas mailing list