title: __getattr__ for static/class variables
body: <p>I have a class like:</p>
  
  <pre><code>class MyClass:
       Foo = 1
       Bar = 2
  </code></pre>
  
  <p>Whenever <code>MyClass.Foo</code> or <code>MyClass.Bar</code> is invoked, I need a custom method to be invoked before the value is returned. Is it possible in Python? I know it is possible if I create an instance of the class and I can define my own <code>__getattr__</code> method. But my scnenario involves using this class as such without creating any instance of it.</p>
  
  <p>Also I need a custom <code>__str__</code> method to be invoked when <code>str(MyClass.Foo)</code> is invoked. Does Python provide such an option?</p>