Skip to content

Commit 2850a4e

Browse files
committed
[config] Rename ARGS.update to ARGS.add_if_not_set, because replace is not used
1 parent 21e2790 commit 2850a4e

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

bin/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,9 @@ def get_arg(key: str, default: T, constraint: Optional[str] = None) -> T:
272272
print(key, type(kwargs[key]))
273273
warn(f"unknown key in {source}: '{key}'")
274274

275-
def update(self, args: "ARGS", replace: bool = False) -> None:
275+
def add_if_not_set(self, args: "ARGS") -> None:
276276
for key in args._set:
277-
if key not in self._set or replace:
277+
if key not in self._set:
278278
setattr(self, key, getattr(args, key))
279279
self._set.add(key)
280280

bin/tools.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,8 +1091,7 @@ def read_personal_config(problem_dir: Optional[Path]) -> None:
10911091
warn(f"invalid data in {config_data}. SKIPPED.")
10921092
continue
10931093

1094-
tmp = config.ARGS(config_file, **config_data)
1095-
config.args.update(tmp)
1094+
config.args.add_if_not_set(config.ARGS(config_file, **config_data))
10961095

10971096

10981097
def run_parsed_arguments(args: argparse.Namespace, personal_config: bool = True) -> None:

0 commit comments

Comments
 (0)