pyufunc.dict_set_by_path#
- pyufunc.dict_set_by_path(mapping, key_path, value, *, separator='.')#
Set a nested dictionary value by key path.
- Parameters:
mapping – Source mapping.
key_path – Key path to set.
value – Value to assign.
separator – Key path separator.
Note
Source package:
python-benedict.Source repository: fabiocaccamo/python-benedict
Source document: fabiocaccamo/python-benedict
Source license: MIT License.
Example
>>> dict_set_by_path({}, "a.b", 1) {'a': {'b': 1}}