title: What is the problem with shadowing names defined in outer scopes?
body: <p>I just switched to PyCharm and I am very happy about all the warnings and hints it provides me to improve my code. Except for this one which I don't understand:</p>
  <blockquote>
  <p>This inspection detects shadowing names defined in outer scopes.</p>
  </blockquote>
  <p>I know it is bad practice to access variable from the outer scope, but what is the problem with shadowing the outer scope?</p>
  <p>Here is one example, where PyCharm gives me the warning message:</p>
  <pre><code>data = [4, 5, 6]
  
  def print_data(data): # &lt;-- Warning: &quot;Shadows 'data' from outer scope
      print data
  
  print_data(data)
  </code></pre>