def extend_config(config, config_items):
 for (key, val) in list(config_items.items()):
  if hasattr(config, key):
   setattr(config, key, val)
 return config

def extend_config ( config , config_items ) : for ( key , val ) in list ( config_items . items ( ) ) : if hasattr ( config , key ) : setattr ( config , key , val ) return config
we are handling config value setting like this for a cleaner api .