Misc¶
Use libbot.utils.misc to import the below functions.
nested_delete(target, *path)
¶
nested_set(target, value, *path, create_missing=True)
¶
Set the key by its path to the value
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target
|
dict[str, Any]
|
Dictionary to perform the modification on. |
required |
value
|
Any
|
New value. |
required |
*path
|
str
|
Path to the key. |
()
|
create_missing
|
bool
|
Create keys on the way if they're missing. Defaults to True. |
True
|
Raises:
| Type | Description |
|---|---|
KeyError
|
Key is not found under the provided path. |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
dict[str, Any]: Modified dictionary. |