
Dec. 1, 2022
8:43 a.m.
On 1/12/22 6:58 am, Anony Mous wrote:
local: for MyVal in range(0,10) pass
provides scoping, making it easier for us to code, debug, and document, while significantly decreasing the likelihood of variable collisions.
I'm not convinced it would be beneficial in Python. In C you have declarations that make it clear when you're introducing a new variable, but in Python there's nothing saying that MyVal has a restricted scope other than the rather inconspicuous "local:" above it. -- Greg