lisa.utils.set_nested_key#

lisa.utils.set_nested_key(mapping, key_path, val, level=None)[source]#

Set a key in a nested mapping

Parameters:
  • mapping (collections.abc.MutableMapping) – The mapping to update

  • key_path (list) – Path to the key in the mapping, in the form of a list of keys.

  • level (collections.abc.Callable) – Factory used when creating a level is needed. By default, type(mapping) will be called without any parameter.