title: How to get instance attribute inside magic __getattr__?
body: <p>In a class I want to map call to <code>inst.addr</code> to a value crated by calling <code>inst.addr_fun()</code>, and thus created this code:</p>
  
  <pre><code>class Common:
      ...
      def __getattr__(self, name):
          if hasattr(self, '{}_fun'.format(name)):
              return getattr(self, '{}_fun'.format(name))()
          else:  
              raise AttributeError('attribute unknown in instance')
      def addr_fun(self):
          return 42
  </code></pre>
  
  <p>However, it results in recursion, since the <code>getattr</code> calls <code>__getattr__</code>, so I can't get access to the <code>addr_fun</code> function.</p>
  
  <p>How to get access to a named attribute inside the instance?</p>