Skip to content

Instantly share code, notes, and snippets.

@nad2000
Created May 19, 2015 02:15
Show Gist options
  • Save nad2000/69848382648356a57e25 to your computer and use it in GitHub Desktop.
Save nad2000/69848382648356a57e25 to your computer and use it in GitHub Desktop.
Simple configuration implementation form dictionary
class configuration(dict):
def __getattr__(self, name):
return self.get(name)
def __setattr__(self, name, value):
self[name] = value
###
conf = configuration()
conf.aaa = 893282
conf.aaa
conf.aaa = "aaa"
conf.aaa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment