title: Python __getattribute__ with 'is-a'/'has-a' relation
body: <p>Working with python3 I am a bit stumped on why <code>__getattribute__</code> isn't working with my class structure.
  I googled around but could not understand why it won't work.</p>
  <p>Here is the no-frills class structure, removing all that was not required:</p>
  <pre><code>class Platform:
    def execute(self):
      print(&quot;Calling execute in Platform&quot;)
  
  class Host():
    def __init__(self):
      self.plat = Platform()
  
    def __getattr__(self, name):
      if name in dir(self):
        return self.__getattribute__(name)
      if name in dir(self.plat):
        return self.plat.__getattribute__(name)
  
  class Connector(Host):
    pass
  
  class LDAP():
    def __init__(self):
      self.conn = Connector()
  
    def __getattr__(self, name):
      return self.conn.__getattribute__(name)
  </code></pre>
  <p>I have a working object <code>ldp = LDAP()</code>. Calling <code>ldp.execute()</code> raises <code>AttributeError: 'Connector' object has no attribute 'execute'</code></p>
  <p>I would expect calling <code>ldp.execute()</code> would do the following:</p>
  <ul>
  <li>Call <code>__getattr__</code> from <code>LDAP</code> which calls <code>__getattribute__</code> on <code>Connector</code> object</li>
  <li>That would again call <code>__getattr__</code> on <code>Host</code> which would call <code>__getattribute__</code> on <code>Platform</code> object</li>
  <li>That would eventually call <code>execute</code> method from <code>Platform</code></li>
  </ul>
  <p>And ofcourse that isn't working as expected :)</p>
  <p>If however, I call <code>self.conn.__getattr__(name)</code> from <code>__getattr__</code> in LDAP class, that works, maybe because I have <code>__getattr__</code> defined in Host.</p>
  <p>What am I missing here ?</p>
  <p><strong>Note: I can't modify the Platform and Host classes. Only Connector and LDAP are mine</strong></p>