title: How to change a module variable from another module?
body: <p>Suppose I have a package named <code>bar</code>, and it contains <code>bar.py</code>:</p>
  
  <pre><code>a = None
  
  def foobar():
      print a
  </code></pre>
  
  <p>and <code>__init__.py</code>:</p>
  
  <pre><code>from bar import a, foobar
  </code></pre>
  
  <p>Then I execute this script:</p>
  
  <pre><code>import bar
  
  print bar.a
  bar.a = 1
  print bar.a
  bar.foobar()
  </code></pre>
  
  <p>Here's what I expect:</p>
  
  <pre><code>None
  1
  1
  </code></pre>
  
  <p>Here's what I get:</p>
  
  <pre><code>None
  1
  None
  </code></pre>
  
  <p>Can anyone explain my misconception?</p>