add_to_dict

Contents

add_to_dict#

tollan.utils.dict.add_to_dict(d: MutableMapping, key: Any, *, exist_ok: bool = True) Any[source]#

Return a decorator to add decorated item to dict.

When key is callable, it generate the actual key by invoking it with the decorated item.