title: Listing instance attributes with __dict__
body: <p>Hi I am trying to use composition to create a new class using instances of another class when I try to turn the new object into a dictionary using <code>__dict__</code>, it's shows me <code>&lt;__main__.myobjec object at 0x00000000029CA908&gt;</code>, not sure am I using the <code>__dict__</code> incorrectly though I have heard its related to new classes, any help greatly appreciated.</p>
  
  <pre><code>class User:
  
      def __init__(self, name, job=None):
  
          self.name = name
          self.job = job
  
  
  class Customer(User):
  
      _ID = 100
  
      def __init__(self, name, job=None):
  
          self.name = name
          self.job = job
  
  
  class Account:
  
      _ID = 0
  
      def __init__(self, name, job=None):
  
          self.customer = Customer(name , "Customer")
  
      def __getattr__(self, attr):
  
              return getattr(self.customer, attr)
  </code></pre>
  
  
  
  <pre><code>&gt;&gt;&gt; A = Account("Abdi")
  &gt;&gt;&gt; A.__dict__
  {'customer': &lt;__main__.Customer object at 0x109fdbfc8&gt;}
  &gt;&gt;&gt; 
  </code></pre>