MCPcopy Create free account
hub / github.com/ipython/ipython / _merge

Function _merge

IPython/core/display.py:41–51  ·  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

39 return False
40
41def _merge(d1, d2):
42 """Like update, but merges sub-dicts instead of clobbering at the top level.
43
44 Updates d1 in-place
45 """
46
47 if not isinstance(d2, dict) or not isinstance(d1, dict):
48 return d2
49 for key, value in d2.items():
50 d1[key] = _merge(d1.get(key), value)
51 return d1
52
53def _display_mimetype(mimetype, objs, raw=False, metadata=None):
54 """internal implementation of all display_foo methods

Callers 1

displayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected