Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

support configs which include lists in config.update #27

Open
lucaslie opened this issue Dec 17, 2021 · 0 comments
Open

support configs which include lists in config.update #27

lucaslie opened this issue Dec 17, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@lucaslie
Copy link

lucaslie commented Dec 17, 2021

We should probably eventually support lists as well here since this might lead to some unexpected behaviors if we load yaml files that include lists of dicts.

def update(self, other: Dict) -> None:
for key, value in other.items():
if isinstance(value, dict):
if key not in self or not isinstance(self[key], Config):
self[key] = Config()
self[key].update(value)
else:
self[key] = value

@zhijian-liu zhijian-liu self-assigned this Dec 27, 2021
@zhijian-liu zhijian-liu added the enhancement New feature or request label Dec 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants