MCPcopy
hub / github.com/msgspec/msgspec / _merge_json

Function _merge_json

src/msgspec/inspect.py:706–722  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

704
705
706def _merge_json(a, b):
707 if b:
708 a = a.copy()
709 for key, b_val in b.items():
710 if key in a:
711 a_val = a[key]
712 if isinstance(a_val, dict) and isinstance(b_val, dict):
713 a[key] = _merge_json(a_val, b_val)
714 elif isinstance(a_val, (list, tuple)) and isinstance(
715 b_val, (list, tuple)
716 ):
717 a[key] = list(a_val) + list(b_val)
718 else:
719 a[key] = b_val
720 else:
721 a[key] = b_val
722 return a
723
724
725class _Translator:

Callers 1

translateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…