I keep getting warnings in PyCharm saying "Shadows name from outer scope" and I keep trying to clean it up so that the warning disappears. No matter what I do, I can't seem to figure out how to get rid of the warning.
Here's one example:
def move_rooms(room, direction):
new_room = room
for i in rooms:
if i == room:
if direction in rooms[i]:
new_room = rooms[i][direction]
return new_room
Here are the warnings I'm getting:
Shadows name 'direction' from outer scope: 1
Shadows name 'new_room' from outer scope: 2
Shadows name 'new_room' from outer scope: 6
I'm fairly new to using PyCharm, I thought that the code looked fine. What should I do differently to clean this up?