Skip to content

Instantly share code, notes, and snippets.

@chetmancini
Created May 11, 2016 16:49
Show Gist options
  • Save chetmancini/1bae29f7d3bbd2b746e4aa2826d59547 to your computer and use it in GitHub Desktop.
Save chetmancini/1bae29f7d3bbd2b746e4aa2826d59547 to your computer and use it in GitHub Desktop.
Make a python class wrap another composed object
def _wrap_fn(params)
return params # do whatever here
def __getattr__(self, method_name):
return lambda msg: getattr(self._subobject, method_name)(self._wrap_fn(params))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment