Differences between static and instance variables in python. Do they even exist?
<p>A random class definition:</p>

<pre><code>class ABC:
    x = 6
</code></pre>

<p>Setting some values, first for the abc instance, later for the static variable:</p>

<pre><code>abc = ABC()
abc.x = 2
ABC.x = 5
</code></pre>

<p>and then print the results:</p>

<pre><code>print abc.x
print ABC.x
</code></pre>

<p>which prints</p>

<pre><code>2
5
</code></pre>

<p>Now, I don't really get what is going on, because if i replace in the class definition x = 6 for "pass", it will just output the same thing. My question is, what is the purpose of defining a variable in the class definition in python if it seems like i can anyone set at any time any variable without doing so? </p>

<p>Also, does python know the difference between instance and static variables? From what I saw, I'd say so.</p>
