You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's one I came across in the wild the other day:
foriinrange(5):
print(i)
i+=1
Pylint doesn't have any problem with it. In the real-world case I saw, it didn't cause a change in behavior, but the variable mutation line was unintended and unneeded.
Desired solution
Mutating the variable of a for-loop is most likely a mistake, and in any case it's not a very good practice. I would like Pylint to flag it, and I think such a check could be enabled by default without too much difficulty.
Additional context
No response
The text was updated successfully, but these errors were encountered:
Current problem
Here's one I came across in the wild the other day:
Pylint doesn't have any problem with it. In the real-world case I saw, it didn't cause a change in behavior, but the variable mutation line was unintended and unneeded.
Desired solution
Mutating the variable of a
for
-loop is most likely a mistake, and in any case it's not a very good practice. I would like Pylint to flag it, and I think such a check could be enabled by default without too much difficulty.Additional context
No response
The text was updated successfully, but these errors were encountered: