sametmax/Bat-belt — pull request #1 by morgan-del (2013-06-06 14:59:48+00:00)
Title: A customisable dmerge

This dmerge lets the user to define how to merge a key shared by both dict::

>>> def my_merge(v1, v2):
... if isinstance(v1, dict) and isinstance(v2, dict):
... return dmerge(v1, v2, my_merge)
... return v2
>>> dmerge({"a": 1, "b": {'ok': 5}}, {"b": {'ko': 5 }, "c": 3}, my_merge)
{'a': 1, 'c': 3, 'b': {'ko': 5, 'ok': 5}}