A
Antoine De Groote
for x in range(3): pass
After this statement is executed x is global variable. This seems very
unnatural to me and caused me 3 three days of debugging because I was
unintentionally using x further down in my program (typo). I would have
thought that variables like this are local to the for block.
Is there a reason this is not the case? Maybe there are PEPs or
something else about the matter that you can point me to?
Regards,
antoine
After this statement is executed x is global variable. This seems very
unnatural to me and caused me 3 three days of debugging because I was
unintentionally using x further down in my program (typo). I would have
thought that variables like this are local to the for block.
Is there a reason this is not the case? Maybe there are PEPs or
something else about the matter that you can point me to?
Regards,
antoine