dict_merge

dict_merge(a, b)[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}

Parameters:
  • a (dict)

  • b (dict | Any)

Return type:

dict