MCPcopy Create free account
hub / github.com/LabPy/lantz / _merge_dicts

Function _merge_dicts

lantz/driver.py:27–43  ·  view source on GitHub ↗

_merge_dicts(dict1, [dict2 [...]]) -> dict1.update(dict2);dict1.update ... Merge argument dictionaries into the first treating None as an empty dictionary.

(*args)

Source from the content-addressed store, hash-verified

25logger = get_logger('lantz.driver', False)
26
27def _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
46class MetaSelf(type):

Callers 2

updateMethod · 0.85
update_asyncMethod · 0.85

Calls 1

updateMethod · 0.80

Tested by

no test coverage detected