News for hackers. Stuff that matters.
Re:What’s New in ES2019 by sbergot on Tuesday July 30, 2019 @12:05PM (#20566203)
In Python things are a bit different because declarations and assignments are ambiguous.
Re:What’s New in ES2019 by masklinn on Wednesday July 31, 2019 @07:51AM (#20573550)
They're not ambiguous, assignments are declarations unless the variable was pre-declared (via global or nonlocal).

Assignment was specifically made a statement to avoid the confusion / typo risks of `=` v `==`.

Re:What’s New in ES2019 by sbergot on Wednesday July 31, 2019 @12:21PM (#20575683)
They are not ambiguous if you have the whole file in your head. This is why there are keywords like "global" & "nonlocal".
Re:What’s New in ES2019 by masklinn on Wednesday July 31, 2019 @01:09PM (#20576176)
> They are not ambiguous if you have the whole file in your head.

They're not ambiguous period, python's `=` always performs a local declaration unless overridden via the keywords you mentioned.

> This is why there are keywords like "global" & "nonlocal".

It's the exact opposite of your statement: `global` and `nonlocal` indicate non-local bindings, because by default all bindings are local and you do not need to have "the whole file in your head".

Re:What’s New in ES2019 by empyrical on Tuesday July 30, 2019 @04:27PM (#20568775)
Also its addition to Python was controversial, to say the least. (I have been enjoying using it, however)