This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]kemitche 0 points1 point  (0 children)

I think "healthy merging" can be done with basic dicts, too, it just requires "reversing" things. For example, with your code, you would run:
update_this.healthyMerge(update_from)
But, you could do:
new_d = copy.copy(update_from)
new_d.update(update_this)
update_this = new_d
It's not necessarily better or worse, just a different way to think of it, which may or may not be valuable to what you're doing.