bolero.utils
.from_dict¶bolero.utils.
from_dict
(config, name=None)[source]¶Create an object of a class that is fully specified by a config dict.
This will recursively go through all lists, tuples and dicts that are in the configuration. It will start to construct all objects starting from the leaves. For example
config = {"type": "Class1", "arg1": {"type": "Class2"}}
obj = from_dict(config)
is equivalent to
tmp = Class2()
obj = Class1(arg1=tmp)
Parameters: |
|
---|---|
Returns: |
|