MCPcopy Index your code
hub / github.com/ipython/ipython / _merge

Function _merge

IPython/core/display_functions.py:19–29  ·  view source on GitHub ↗

Like update, but merges sub-dicts instead of clobbering at the top level. Updates d1 in-place

(d1, d2)

Source from the content-addressed store, hash-verified

17
18
19def _merge(d1, d2):
20 """Like update, but merges sub-dicts instead of clobbering at the top level.
21
22 Updates d1 in-place
23 """
24
25 if not isinstance(d2, dict) or not isinstance(d1, dict):
26 return d2
27 for key, value in d2.items():
28 d1[key] = _merge(d1.get(key), value)
29 return d1
30
31
32#-----------------------------------------------------------------------------

Callers 1

displayFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…