title: How are arguments passed to a function through __getattr__
body: <p>Consider the following code example (python 2.7):</p>
  
  <pre><code>class Parent:
      def __init__(self, child):
          self.child = child
  
      def __getattr__(self, attr):
          print("Calling __getattr__: "+attr)
          if hasattr(self.child, attr):
              return getattr(self.child, attr)
          else:
              raise AttributeError(attr)
  
  class Child:
      def make_statement(self, age=10):
          print("I am an instance of Child with age "+str(age))
  
  kid = Child()
  person = Parent(kid)
  
  kid.make_statement(5)
  person.make_statement(20)
  </code></pre>
  
  <p>it can be shown, that the function call <code>person.make_statement(20)</code> calls the <code>Child.make_statement</code> function through the <code>Parent</code>'s <code>__getattr__</code> function. In the <code>__getattr__</code> function I can print out the attribute, before the corresponding function in the child instance is called. So far so clear. </p>
  
  <p>But how is the argument of the call <code>person.make_statement(20)</code> passed through <code>__getattr__</code>? How am I able to print out the number '20' in my <code>__getattr__</code> function?</p>