-
Notifications
You must be signed in to change notification settings - Fork 105
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
merge_update() not merging lists #181
Labels
Comments
It was not designed that way, but I do think it would be good to include that as a possible option! |
Looking into to being able to give multiple options for how this happens: a = Box()
a.merge_update({"lister": ["a"]})
a.merge_update({"lister": ["a", "b", "c"]}, box_merge_lists="extend")
assert a.lister == ["a", "a", "b", "c"]
a.merge_update({"lister": ["a", "b", "c"]}, box_merge_lists="unique")
assert a.lister == ["a", "a", "b", "c"]
a.merge_update({"lister": ["a", "d", "b", "c"]}, box_merge_lists="unique")
assert a.lister == ["a", "a", "b", "c", "d"]
a.merge_update({"key1": {"new": 5}, "Key 2": {"add_key": 6}, "lister": ["a"]})
assert a.lister == ["a"] |
Merged
cdgriffith
added a commit
that referenced
this issue
Feb 13, 2021
* Adding support for functions to box_recast (thanks to Jacob Hayes) * Adding #181 support for extending or adding new items to list during `merge_update` (thanks to Marcos Dione) * Fixing maintain stacktrace cause for BoxKeyError and BoxValueError (thanks to Jacob Hayes) * Fixing #177 that emtpy yaml files raised errors instead of returning empty objects (thanks to Tim Schwenke) * Fixing #171 that `popitems` wasn't first checking if box was frozen (thanks to Varun Madiath) Co-authored-by: Jacob Hayes <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Does this make sense? I need it for myself, but maybe it's not
box
' responsibility.I was expecting:
or maybe even:
The text was updated successfully, but these errors were encountered: