Skip to content

为什么判断成立反而仅打印一个覆盖通知,却在else分支进行覆盖。 #193

@Juntung

Description

@Juntung

def update_config(args, config, exclude_keys=list()):

def update_config(args, config, exclude_keys=list()):
"""update the args dict with a new config"""
assert isinstance(args, dict) and isinstance(config, dict)
for k in config.keys():
if args.get(k, False):
if args[k] != config[k] and k not in exclude_keys and args[k] is not None:
print(f'overwrite config key -- {k}: {config[k]} -> {args[k]}')
else: 《《《《《《《《《《《《 这里不修改存在吧
args[k] = config[k]
else:
args[k] = config[k]
return args

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions