blob: 3122d386a305ef93f280c9784fee4432b66d8e51 (
plain)
1
2
3
4
5
6
7
8
9
10
|
def merge(a, b):
"merges b into a recursively if a and b are dicts"
for key in b:
if isinstance(a.get(key), dict) and isinstance(b.get(key), dict):
merge(a[key], b[key])
else:
a[key] = b[key]
return a
|