register_func

function of dascore.utils.misc source

register_func(
    list_or_dict: list | dict[<class ’list, <class ’dict] ,
    key = None,
)

Decorator for registering a function name in a list or dict.

If list_or_dict is a list only append the name of the function. If it is as dict append name (as key) and function as the value.

Parameters

Parameter Description
list_or_dict A list or dict to which the wrapped function will be added.
key The name to use, if different than the name of the function.