I've looked at several issues with this topic but I believe this is a new situation. I have this Python code in PyCharm 2022.2.2:
res = []
for i in range(10):
j = i
for k in range(4):
res.append(j)
j = j + 1
On the line j = 1 PyCharm complains about:
"Redeclared 'j' defined above without usage".
Obviously j is not declared above. Changing the line to j += 1 the warning disappears.
Is PyCharm confused or am I missing something?