Created
September 12, 2010 18:57
-
-
Save stepahn/576330 to your computer and use it in GitHub Desktop.
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
class W_SimpleObject(object): | |
def getvalue(self, key = None): | |
for parent in self.get_mro(): | |
try: | |
return parent.getval(key) | |
except KeyError: | |
pass | |
return None | |
x.getvalue() | |
>>> segfault | |
x.getvalue('') | |
> Sunshine, lollipops and double-rainbows |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment