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

Stephen J. Turnbull stephen at xemacs.org
Tue Feb 17 03:14:58 CET 2015


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 />



More information about the Python-ideas mailing list