Recursively merge two dictionaries.
Values from the second are prioritised in case of conflicts. This code
was originally posted on stackoverflow, by Aaron Hall and Bobik.
- Parameters:
- d1
dict The original dictionary.
- d2
dict The new dictionary, which can overwrite values in d1.
- Returns:
dictThe merged dictionary.