Last active
December 16, 2015 19:49
-
-
Save bil-bas/5487740 to your computer and use it in GitHub Desktop.
This file contains 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 __getattr__(self, name): | |
# _children is a list of strings referring to properties in the wrapper object. | |
for child in self._children: | |
child = getattr(self, child) | |
if hasattr(child, name): | |
return getattr(child, name) | |
return AttributeError("No attribute '%s' in any children of %s" % (name, self)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment