Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add recursive boolean option to update #21

Open
rjmoggach opened this issue Nov 24, 2019 · 2 comments
Open

Add recursive boolean option to update #21

rjmoggach opened this issue Nov 24, 2019 · 2 comments

Comments

@rjmoggach
Copy link

I have a nested dictionary that i'd like updated to be empty when I update with a user config. Ideally the top level attribute would be set to {} and then base_cfg.update(user_cfg, recursive=False) would nuke the whole dict with the user value of {}

@rjmoggach
Copy link
Author

for now i'm doing the following:

                for k,v in user_cfg.items():
                    if k in base_cfg and base_cfg[k] != v:
                        base_cfg.set(k,v)

@MartinThoma
Copy link
Owner

I'm not entirely sure if I understand what you want to do.

Could you give me two configuration examples (e.g. two YAML files) which show the current behavior vs the one you would like to get?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants