> 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) Devin On Thu, Aug 11, 2011 at 4:45 PM, Bruce Leban <br...@leapyear.org> wrote: > > On Thu, Aug 11, 2011 at 12:24 PM, Devin Jeanpierre <jeanpierr...@gmail.com> > wrote: >> >> Javascript also lets you break lines. For example, this does what you want: >> >> return 1 >> + 5 >> >> Whereas this does not >> >> return >> 1 + 5 >> >> Of course, Python would have no such problem, because you could make both >> cases unambiguous due to the indent. >> >> Devin >> > Note that this is already valid and is not a continuation line: > > return 1 > +5 > > 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. > Now allowing line breaks *after* operators would be unambiguous and would not > require new indentation rules. When a line ends with an operator, it's > clearly incomplete (so no fear the reader will think the statement has ended > unlike the above case) and it's a syntax error today: > > return 1 + > 5 > x = y > 0 and > y < 10 > > This code is not valid today without parens or \ regardless of indentation. > I'm +0 on this. I'd use it but does it really add enough convenience? > --- Bruce > Follow me: http://www.twitter.com/Vroo http://www.vroospeak.com -- http://mail.python.org/mailman/listinfo/python-list