lookout.style.common
¶
Module Contents¶
-
lookout.style.common.
merge_dicts
(*dicts)[source]¶ Merge several mappings together; nested values are merged recursively.
Operation is not commutative, each next dictionary overrides values of the previous one for the same keys sequence. (see example). Example: >>> a = {1: 1, 2: {3: 3, 4: 4}} >>> b = {1: 10, 2: {3: 30, 4: 4, 5: 5}} >>> merge_dicts(a, b) >>> {1: 10, 2: {3: 30, 4: 4, 5: 5}} >>> merge_dicts(b, a) >>> {1: 1, 2: {3: 3, 4: 4, 5: 5}}
Returns: New merged dictionary.