title: Python: self.__class__ vs. type(self)
body: <p>I'm wondering if there is a difference between</p>
  
  <pre><code>class Test(object):
      def __init__(self):
          print self.__class__.__name__
  </code></pre>
  
  <p>and</p>
  
  <pre><code>class Test(object):
      def __init__(self):
          print type(self).__name__
  </code></pre>
  
  <p>?</p>
  
  <p>Is there a reason to prefer one or the other? </p>
  
  <p>(In my use case I want to use it to determine the logger name, but I guess this doesn't matter)</p>