dctools.utilities.misc_utils.transform_in_place

dctools.utilities.misc_utils.transform_in_place(obj, func)

Recursively apply a function to all elements of a nested structure in place.

Parameters:
  • obj – The object to transform (dict, list, or scalar).

  • func (Callable) – The function to apply to leaf elements.

Returns:

The transformed object.

Return type:

Any