_merge_dicts(dict1, [dict2 [...]]) -> dict1.update(dict2);dict1.update ... Merge argument dictionaries into the first treating None as an empty dictionary.
(*args)
| 25 | logger = get_logger('lantz.driver', False) |
| 26 | |
| 27 | def _merge_dicts(*args): |
| 28 | """ _merge_dicts(dict1, [dict2 [...]]) -> dict1.update(dict2);dict1.update ... |
| 29 | |
| 30 | Merge argument dictionaries into the first treating None as an empty |
| 31 | dictionary. |
| 32 | """ |
| 33 | |
| 34 | args = [arg for arg in args if arg] |
| 35 | |
| 36 | if not args: |
| 37 | return {} |
| 38 | |
| 39 | out = copy.copy(args[0]) |
| 40 | for arg in args[1:]: |
| 41 | out.update(arg) |
| 42 | |
| 43 | return out |
| 44 | |
| 45 | |
| 46 | class MetaSelf(type): |
no test coverage detected