[Python-ideas] allow line break at operators
Terry Reedy
tjreedy at udel.edu
Fri Aug 12 00:31:32 CEST 2011
On 8/11/2011 5:06 PM, Devin Jeanpierre wrote:
>> Right now you do not need to indent continuation lines. So in order
>> to disambiguate you would need to enforce indentation for
>> continuations, but for backward compatibility that would only be
>> required when not using parentheses or backslashes. Ick. Can blank
>> lines or comment lines appear between a line and its continuation?
>> That's allowed now as well.
>
> Eek no. If I was suggesting anything, it would have been a third
> form of continuation: collapsing subsequent extra-indented lines.
> This is never ambiguous. (This could be done in such a way as to
> permit comments, namely, by doing it to the tokenstream rather than
> to the actual text)
One bit of reality for these types of proposals. Cpython is implemented
with an auto-generated LL(1) parser and will remain that way. Hence, all
grammar proposals must stay within the bounds of LL(1) context-free
languages. I would not be surprised if some of the proposals have
'jumped the fence'. But it can be hard to tell without a concrete
grammar revision that can be run thru the LL(1) parser generator.
Aside from that, discuss away.
--
Terry Jan Reedy
More information about the Python-ideas
mailing list