Closed mdione-cloudian closed 3 years ago
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"]
Does this make sense? I need it for myself, but maybe it's not
box
' responsibility.I was expecting:
or maybe even: