| Total Complexity | 5 |
| Total Lines | 16 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | # -*- coding: utf-8 -*- |
||
| 2 | |||
| 3 | from benedict.utils import type_util |
||
| 4 | |||
| 5 | |||
| 6 | def merge(d, other, *args): |
||
| 7 | others = [other] + list(args) |
||
| 8 | for other in others: |
||
| 9 | for key, value in other.items(): |
||
| 10 | src = d.get(key, None) |
||
| 11 | if type_util.is_dict(src) and type_util.is_dict(value): |
||
| 12 | merge(src, value) |
||
| 13 | else: |
||
| 14 | d[key] = value |
||
| 15 | return d |
||
| 16 |