News for hackers. Stuff that matters.
Re:Python’s tug of war between beginner-friendly and advance... by pansa2 on Friday February 05, 2021 @04:13AM (#26034461)
The justification for function-scope instead of block-scope is that only the former really works if you have implicit variable declarations.

In turn, implicit variable declarations (using the same syntax for initialisation and assignment) are a reasonable choice for a language that aimed to be “executable pseudocode” and that supports mixing initialisation and assignment in a single statement (e.g. `a, b, self.c = foo()`).

Re:Python’s tug of war between beginner-friendly and advance... by Blikkentrekker on Friday February 05, 2021 @04:46AM (#26034619)
It could easily be written as `var a, var b, self.c = foo()`.

Having the same syntax for initialization and assignment is quite quæstionable.

Re:Python’s tug of war between beginner-friendly and advance... by pansa2 on Friday February 05, 2021 @05:16AM (#26034777)
That’s not a bad suggestion, but it’s quite verbose (it would require declaring multiple variables as `var x, var y, var z` instead of `var x, y, z`).
Re:Python’s tug of war between beginner-friendly and advance... by Blikkentrekker on Friday February 05, 2021 @04:10PM (#26041249)
That could easily be `var (x, y, z) =`, which is similar to what many languages use.