3 ms·
I would say proper variable scoping in general. It would be awesome to have let variables in python!
by maxs 6y ago
I would say proper variable scoping in general. It would be awesome to have let variables in python!
- zo1 6y agoVariables are scoped just fine from my point of view. What do you mean by proper?
- maxs 6y agoI meant to say block scoped. Variables in python have function or global scope but no global scope. E.g. you can say for x in ...: and then use x outside of the loop.
- knighthack 6y agoI have no idea why you would want to declare an x in the loop, and then use it outside the loop. There are better ways of doing things. The fact that you can do such a thing in JavaScript is exactly why JavaScript is such a mess of a language with its globally-declared and hoisted variables. That sort of practice has never made sense, and is not a language design that Python should follow.
- deleted 6y ago[deleted]