upkie 9.0.0
Open-source wheeled biped robots
Loading...
Searching...
No Matches

◆ nested_update()

None nested_update ( dict  target_dict,
dict  new_dict 
)

Update a target dictionary recursively.

Consider the following example:

>>> d = {"a": {"b": 1}}
>>> d2 = {"a": {"c": 2}}
>>> d.update(d2)
>>> d
{'a': {'c': 2}}

With this function:

>>> d = {"a": {"b": 1}}
>>> d2 = {"a": {"c": 2}}
>>> d.update(d2)
>>> d
{'a': {'b': 1, 'c': 2}}
Parameters
target_dictOutput dictionary.
new_dictInput dictionary with new values to update.