title: How to share static class variables between files?
body: <p>I was trying to share data via static class between two modules. Should've been pretty simple, but it turns out I'm hitting some kind of gotcha. Here's the code.</p>
  
  <p><strong>testa.py</strong></p>
  
  <pre><code>class Tc:
      a = 0
  
  
  if __name__ == "__main__":
      import testb
      print(Tc.a)
  </code></pre>
  
  <p><strong>testb.py</strong></p>
  
  <pre><code>import testa
  
  print(testa.Tc.a)
  testa.Tc.a = 1
  
  print(testa.Tc.a)
  </code></pre>
  
  <p>Run the command</p>
  
  <blockquote>
    <p>python testa.py</p>
  </blockquote>
  
  <p>The expected out put was</p>
  
  <pre><code>0
  1
  1
  </code></pre>
  
  <p>but I' getting </p>
  
  <pre><code>0
  1
  0
  </code></pre>
  
  <p>Whats going on?</p>