Source code for herostools.helper

from heros.helper import get_logger

log = get_logger("herostools")


[docs] def merge_dicts(dict1, dict2) -> dict: """ Recursively merge two dicts of dicts. """ new_dict = dict1.copy() for k, v in dict2.items(): if k in dict1 and isinstance(dict1[k], dict) and isinstance(v, dict): new_dict[k] = merge_dicts(new_dict[k], v) else: new_dict[k] = v return new_dict