iqm.pulse.base_utils.merge_dicts

Contents

iqm.pulse.base_utils.merge_dicts#

iqm.pulse.base_utils.merge_dicts(A, B, path=(), merge_nones=True)#

Merge two dictionaries recursively, leaving the originals unchanged.

Parameters:
  • A (dict[str, Any]) – dictionary

  • B (dict[str, Any]) – another dictionary

  • merge_nones (bool) – whether to also merge None and empty Sized values from B to A.

  • path (tuple[str, ...])

Returns:

copy of A, with the contents of B merged in (and taking precedence) recursively

Return type:

dict[str, Any]