title: Python: Why is __getattr__ catching AttributeErrors?
body: <p>I'm struggling with <code>__getattr__</code>. I have a complex recursive codebase, where it is important to let exceptions propagate.</p>
  
  <pre><code>class A(object):
      @property
      def a(self):
          raise AttributeError('lala')
  
      def __getattr__(self, name):     
          print('attr: ', name)
          return 1      
  
  print(A().a)
  </code></pre>
  
  <p>Results in:</p>
  
  <pre><code>('attr: ', 'a')
  1
  </code></pre>
  
  <p>Why this behaviour? Why is no exception thrown? This behaviour is not documented (<a href="http://docs.python.org/reference/datamodel.html?highlight=__getattribute__#object.__getattr__" rel="noreferrer"><code>__getattr__</code> documentation</a>). <code>getattr()</code> could just use <code>A.__dict__</code>. Any thoughts?</p>