title: Python name of class in class body
body: <p>Is it possible to get the class name within the body of a class definition?</p>
  
  <p>For example,</p>
  
  <pre><code>class Foo():
      x = magic() # x should now be 'Foo'
  </code></pre>
  
  <p>I know that I can do this statically outside of the class body using a class method:</p>
  
  <pre><code>class Bar():
      @classmethod
      def magic(cls):
          print cls.__name__
  
  Bar.magic()
  </code></pre>
  
  <p>However this isn't what I want, I want the class name in the class body</p>