Guido van Rossum wrote:
Can we skip ahead to considering how to implement this? I can think of two approaches: either hack the lexer to special-case a newline followed by a period (which currently can never start a line), or redesign the syntax to allow NEWLINE INDENT ‘.’ ......... NEWLINE ‘.’ ............ DEDENT at the end of an expression. Both have pros and cons. Discuss how this allows for certain typos to pass as valid syntax.
IIRC, BCPL's compiler would continue and expression on the next line if a line ended with an operator. E.g.: x = a + b would parse like x = (a + b); (I think this was a bit more general - if a line didn't end with ";", the parser would try adding a ";" and if that failed to parse, it would continue to the next line.) This leads result in a different style for method-chaining: y = x.rstrip("\n"). split(":")[0]. lower() ... and if you don't like ending lines with a ".", you could always add a parenthesis: y = (x.rstrip("\n") .split(":")[0] .lower()) [I wonder why C didn't adopt BCPL's convention for eliding semi-colons? ...]