Utils
NumberType
Bases: Enum
Enumeration FLOAT or DECIMAL to specify number type.
Source code in configcalc/utils.py
13 14 15 16 17 |
|
get_deep(nested_list, indices)
Gets element in nested list
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nested_list
|
list[Any]
|
list with possible sublists |
required |
indices
|
list[int]
|
list of indices on each list to locate the element, from top to bottom |
required |
Returns:
Name | Type | Description |
---|---|---|
Any |
Any
|
element value |
Source code in configcalc/utils.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
set_deep(nested_list, indices, value)
Sets an element value deep in a nested list
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nested_list
|
list[Any]
|
nested list |
required |
indices
|
list[int]
|
list of indices to the element |
required |
value
|
Any
|
new value of element |
required |
Returns:
Type | Description |
---|---|
list[Any]
|
list[Any]: nested list with updated value of element |
Source code in configcalc/utils.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|