[Python-projects] pylint: Avoidable W0631
Jürgen Hermann
Juergen.Hermann at 1und1.de
Tue May 5 12:14:51 CEST 2009
The following can be detected since the loop variable is assigned to in the else clause (since either the loop target list gets assigned to, OR the else clause runs).
> cat lint2.py
"Avoidable W0631"
for defined in range(0):
pass
else:
defined = -1
print defined
> pylint -rn -iy lint2.py
************* Module lint2
W0631: 7: Using possibly undefined loop variable 'defined'
> python lint2.py
-1
More information about the Python-Projects
mailing list