Files
openide/python/python-psi-impl/resources/inspectionDescriptions/PyAssignmentToLoopOrWithParameterInspection.html
Louis Vignier 1869ec9da6 [codeInspection] Fix python inspection descriptions
GitOrigin-RevId: 56876a5dd073a06c3fcc92f63ed1f5674830bc25
2023-04-28 13:13:25 +00:00

20 lines
476 B
HTML

<html>
<body>
Reports the cases when you rewrite a loop variable with an inner loop.
<p><b>Example:</b></p>
<pre><code>
for i in range(5):
for i in range(20, 25):
print("Inner", i)
print("Outer", i)
</code></pre>
It also warns you if a variable declared in the <code>with</code> statement is redeclared inside the statement body:
<pre><code>
with open("file") as f:
f.read()
with open("file") as f:
</code></pre>
</body>
</html>