Skip to content

Instantly share code, notes, and snippets.

@sloria
Created June 30, 2013 16:10
Show Gist options
  • 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