title: what's the difference between dir(self) and self.__dict__
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/6761106/inspect-getmembers-vs-dict-items-vs-dir">inspect.getmembers() vs __dict__.items() vs dir()</a>  </p>
  </blockquote>
  
  
  
  <pre><code>class Base():
      def __init__(self, conf):
          self.__conf__ = conf
          for i in self.__dict__:
              print i,"dict"
          for i in dir(self):
              print i,"dir"
  
  class Test(Base):
        a = 1
        b = 2
  
  t = Test("conf")
  </code></pre>
  
  <p>The output is:</p>
  
  <pre><code>__conf__ dict
  __conf__ dir
  __doc__ dir
  __init__ dir
  __module__ dir
  a dir
  b dir
  </code></pre>
  
  <p>Can anyone explain a little bit about this?</p>