Skip to content

Instantly share code, notes, and snippets.

@sloria
Created June 30, 2013 16:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sloria/5895770 to your computer and use it in GitHub Desktop.
Save sloria/5895770 to your computer and use it in GitHub Desktop.
class Config:
def __init__(self, **entries):
self.entries = entries
def __add__(self, other):
entries = (self.entries.items() +
other.entries.items())
return Config(**entries)
default_config = Config(color=False, port=8080)
config = default_config + Config(color=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment