title: Class variable scope for static vs class methods
body: <p>I discovered a weird behaviour (at least weird for me) on python class variables.</p>
  
  <pre><code>class Base(object):
      _var = 0
  
      @classmethod
      def inc_class(cls):
          cls._var += 1
  
      @staticmethod
      def inc_static():
          Base._var += 1
  
  class A(Base):
      pass
  
  class B(Base):
      pass
  
  a = A()
  b = B()
  
  a.inc_class()
  b.inc_class()
  a.inc_static()
  b.inc_static()
  
  print(a._var)
  print(b._var)
  print(Base._var)
  </code></pre>
  
  <p>The output is <code>1 1 2</code>.</p>
  
  <p>This is surprising me (I was expecting <code>4 4 4</code>) and I'm wondering why?</p>