Created
April 12, 2014 03:37
-
-
Save messense/10517540 to your computer and use it in GitHub Desktop.
Python ObjectDict
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 ObjectDict(dict): | |
def __getattr__(self, key): | |
if key in self: | |
return self[key] | |
return None | |
def __setattr__(self, key, value): | |
self[key] = value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.