Skip to content

Instantly share code, notes, and snippets.

@cluelessperson
Created May 5, 2019 11:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cluelessperson/3bdd6edb2b815203b02093dfc5168ac8 to your computer and use it in GitHub Desktop.
Save cluelessperson/3bdd6edb2b815203b02093dfc5168ac8 to your computer and use it in GitHub Desktop.
class Config(object):
def __init__(self, parent_logger:logging.Logger=logger):
self.log = parent_logger.getChild(self.__class__.__name__)
self.config = {}
print("here")
def __getattr__(self, attr):
try:
return self.config[attr]
except IndexError:
return None
def __setattr__(self, attr, value):
self.config[attr] = value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment