title: PyCharm Weak Warning: 'Shadows name from outer scope'
body: <p>I keep getting warnings in PyCharm saying &quot;Shadows name from outer scope&quot; 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.</p>
  <p>Here's one example:</p>
  <pre><code>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
  </code></pre>
  <p>Here are the warnings I'm getting:</p>
  <ul>
  <li><p>Shadows name 'direction' from outer scope: 1</p>
  </li>
  <li><p>Shadows name 'new_room' from outer scope: 2</p>
  </li>
  <li><p>Shadows name 'new_room' from outer scope: 6</p>
  </li>
  </ul>
  <p>I'm fairly new to using PyCharm, I thought that the code looked fine. What should I do differently to clean this up?</p>