mafw.tools.generics

Functions

deep_update(base_dict, update_dict[, copy_first])

Recursively updates a dictionary.

mafw.tools.generics.deep_update(base_dict: dict[Any, Any], update_dict: dict[Any, Any], copy_first: bool = True) dict[Any, Any][source]

Recursively updates a dictionary.

If copy_first is set to False, then the base_dict is actually updated.

Parameters:
  • base_dict (dict[Any, Any]) – The dictionary to update.

  • update_dict (dict[Any, Any]) – The dictionary containing the updated fields

  • copy_first (bool, Optional) – Whether the base dictionary should be copied or updated. Defaults to True

Returns:

The recursively updated dictionary

Return type:

dict[Any, Any]