6 Mar
2022
6 Mar
'22
9 a.m.
Hi we just noticed there is a potential bug in for loop variable assignment in for loop. variable must unset after the block end at least in other programming language they do but in python 3 last assignment still exist sorry for my bad English but I can tell you with an example for i in range(3): print(i) out put is 0 1 2 but if you call i again print(i) output 2 I don't know it is by purpose for some reason but I haven't seen it in any source so most of the programmers don't handle this situation . this situation can cause over ram usage and it might effect program's efficacy and optimization in large scale programs such as games or data processing if programmers don't handle this situation . Thanks Ali ARSLAN