Files
openide/python/resources/inspectionDescriptions/PyAssignmentToLoopOrWithParameterInspection.html
T
Ilya.Kazakevich b55ee30dc1 PY-11882 Assignment to for loop inspection false positive
PY-3569 Inspection to warn if a loop variable is assigned inside the loop
2014-01-23 03:38:23 +04:00

22 lines
582 B
HTML

<html>
<body>
<span style="font-family: verdana,serif;">
Checks for cases when you rewrite loop variable with inner loop
</span>
<pre style="font-family: monospace">
for i in xrange(5):
for i in xrange(20, 25):
print("Inner", i)
print("Outer", i)
</pre>
<span style="font-family: verdana,serif;">
It also warns you if variable declared in <code>with</code> statement is redeclared inside of statement body:
</span>
<pre style="font-family: monospace">
with open("file") as f:
f.read()
with open("file") as f:
</pre>
</body>
</html>