Python... Static variables?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2714573/instance-variables-vs-class-variables-in-python">Instance variables vs. class variables in Python</a>  </p>
</blockquote>



<p>What is the difference between these two situations and how is it treated with in Python?</p>

<p>Ex1</p>

<pre><code>class MyClass:
     anArray = {}
</code></pre>

<p>Ex2</p>

<pre><code>class MyClass:
     __init__(self):
          self.anArray = {}
</code></pre>

<p>It seems like the in the first example the array is being treated like a static variable. How does Python treat this and what is the reason for this?</p>
