dict_merge

dict_merge(a: dict, b: dict | Any) dict[source]

Recursively merge dictionaries.

This utility function recursively merges dictionaries. If second argument (b) is a dictionary, then a copy of first argument (dictionary a) is created and the elements of b are merged into the new dictionary. Otherwise return argument b.

Examples: >>> dict_merge({'a': {'b': 1}}, {'c': 2}) {'a': {'b': 1}, 'c': 2}