Tech
Config precedence in Python: why your resolver shouldn't know what "CLI" means
Most config systems I've written have the same shape. A function that looks at the environment, looks at the command line, looks at a YAML file, and decides which one wins. Something like this:
def load_config ():
if cli_args . timeout :
return cli_args . timeout
if os . getenv ( " TIMEOUT " ):
return os . getenv ( " TIMEOUT " )
return yaml_config . get ( " timeout " , 30000 )
Multiply that by eve...
Read the full discussion on Dev.to
This article was aggregated from Dev.to. Click to join the conversation.
View on Dev.to