Created
May 11, 2016 16:49
-
-
Save chetmancini/1bae29f7d3bbd2b746e4aa2826d59547 to your computer and use it in GitHub Desktop.
Make a python class wrap another composed object
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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