title: __getattribute__ function to return object value from another class
body: <p>I have a base class which has 2 attributes which itself are from another class. See the code below</p>
  
  <pre><code>class Base(object):
      def __init__(self, obj1, obj2):
          self.obj1 = obj1
          self.obj2 = obj2
  
      def __getattribute__(self, name):
          #import pdb; pdb.set_trace()
          if name == 'obj1':
              obj = object.__getattribute__(self, name) #self.obj1.value
              return object.__getattribute__(obj,'value')
  
  class Temp(object):
      def __init__(self, value, type):
          self.value = value
          self.type = type
  
      def __getattribute__(self, name):
          #if name == 'value':
          #    return object.__getattribute__(self, name)
          if name == 'type':
              return object.__getattribute__(self, name)
  
  if __name__ == "__main__":
      temp_obj1 = Temp(45, type(45))
      temp_obj2 = Temp('string', type('string'))
  
      base_obj = Base(temp_obj1, temp_obj2)
      print base_obj.obj1
      print base_obj.obj1.type
  </code></pre>
  
  <p>and its output:- </p>
  
  <pre><code>45
  Traceback (most recent call last):
    File "getattr.py", line 29, in &lt;module&gt;
      print base_obj.obj1.type
  AttributeError: 'int' object has no attribute 'type'
  </code></pre>
  
  <p>Basically what I am trying to achieve is I don't have to call <code>base_obj.obj1.value</code> to get the <code>value</code> attribute of <code>obj1</code> but calling <code>base_obj.obj1</code> will give the desired result. But at the same time I am be able to call some function or property of <code>obj1</code> like <code>base_obj.obj1.type</code> or <code>base_obj.obj1.some_method()</code></p>
  
  <p>But as you can see I am getting the error. How can I achieve the desired functionality</p>