actio_python_utils.utils.DictToFunc¶
- class actio_python_utils.utils.DictToFunc(choices)[source]¶
Bases:
object
Class that after initializing with a dict can be called to map keys to values, e.g.:
> D = DictToFunc({"a": 42, "b": "apple"}) > D("a") 42 > D("b") apple > D("c") KeyError("c")
- Parameters:
choices (
dict
[Hashable
,Any
]) – The dict to map keys to values
Methods
__init__
(choices)