Chris Angelico wrote:
On Sat, Mar 13, 2021 at 1:46 PM Peter Ludemann peter.ludemann@gmail.com wrote:
It's not clear to me what surprising behaviors there would be. Javascript seems to do OK with optional semicolons - presumably its algorithm is similar to what BCPL used. (Or perhaps the surprising behaviors are trivial compared to the other surprises that Javascript springs on people.) Yes, right up until you try to do something like: function foo() { return thing.goes.here() } which becomes extremely common with frameworks like React.js. There's an implicit semicolon and a big block of dead code. ChrisA
def foo(): return thing.goes.here() is illegal Python; and wouldn't result in a line-join by my proposal. However: def foo(): return "A long piece of text (Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.)" + thing.goes.here() would work by my proposal and avoid the extra parentheses that are currently needed.