Created
August 13, 2014 16:30
-
-
Save hamiltont/d55f21a4136e17290ace 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
class attrExample(d: | |
def __getattr__(self, item): | |
""" | |
Returns the attr if it's part of attrExample, otherwise | |
return the attr from foo | |
""" | |
try: | |
return self.item | |
except KeyError: | |
return foo.item |
msmith-techempower
commented
Aug 13, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment