iqm.pulse.utils.merge_dicts

Contents

iqm.pulse.utils.merge_dicts#

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

Merge two dictionaries recursively, leaving the originals unchanged.

Parameters:
  • A (dict) – dictionary

  • B (dict) – another dictionary

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

Returns:

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

Return type:

dict