title: How can I access "static" class variables within methods in Python?
body: <p>If I have the following code:</p>
  <pre><code>class Foo(object):
      bar = 1
  
      def bah(self):
          print(bar)
          
  f = Foo()
  f.bah()
  </code></pre>
  <p>It complains</p>
  <blockquote>
  <p>NameError: global name 'bar' is not defined</p>
  </blockquote>
  <p>How can I access class/static variable <code>bar</code> within method <code>bah</code>?</p>