title: Proxy object in Python
body: <p>I'm looking for way to pass method calls through from an object (wrapper) to a member variable of an object (wrappee). There are potentially many methods that need to be externalised, so a way to do this without changing the interface of the wrapper when adding a method to the wrappee would be helpful.</p>
  
  <pre><code>class Wrapper(object)
    def __init__(self, wrappee):
      self.wrappee = wrappee
  
    def foo(self):
      return 42
  
  class Wrappee(object):
    def bar(self):
      return 12
  
  o2 = Wrappee()
  o1 = Wrapper(o2)
  
  o1.foo() # -&gt; 42
  o1.bar() # -&gt; 12
  o1.&lt;any new function in Wrappee&gt;() # call directed to this new function 
  </code></pre>
  
  <p>It would be great if this call redirection is "fast" (relative to a direct call, i.e. not adding too much overhead).</p>