Files
bearhub/bauh/commons/util.py
2019-12-17 15:54:01 -03:00

12 lines
342 B
Python

import collections
def deep_update(source: dict, overrides: dict):
for key, value in overrides.items():
if isinstance(value, collections.Mapping) and value:
returned = deep_update(source.get(key, {}), value)
source[key] = returned
else:
source[key] = overrides[key]
return source