Summary
i = 0
for val in [1,2,3]:
print(f"{i}: {val}")
i += 1
i = 0
for val in [1,2,3]:
print(f"{i}: {val}")
i += 1
Only the first i += 1 is reported with SIM113. And if you fix it:
for i,val in enumerate([1,2,3]):
print(f"{i}: {val}")
i = 0
for val in [1,2,3]:
print(f"{i}: {val}")
i += 1
i += 1 is still not reported as an error. Now if you change the variable name:
for i,val in enumerate([1,2,3]):
print(f"{i}: {val}")
j = 0
for val in [1,2,3]:
print(f"{j}: {val}")
j += 1
Now j += 1 is reported with SIM113.
Version
No response
Summary
Only the first
i += 1is reported with SIM113. And if you fix it:i += 1is still not reported as an error. Now if you change the variable name:Now
j += 1is reported with SIM113.Version
No response