rcognita.callbacks.introduce_callbacks
- class rcognita.callbacks.introduce_callbacks(default_callbacks=None)
A class decorator that introduces a callbacks attribute to the decorated class. The callbacks attribute is a list of callbacks that can be applied to methods of instances of the decorated class (for instance via @apply_callbacks).
- __init__(default_callbacks=None)
Initializes the decorator.
- Parameters
default_callbacks – A list of callbacks that will be used as the default value for the callbacks attribute of instances of the decorated class. If no value is specified, the callbacks attribute will be initialized to None, which will in turn make @apply_callbacks use default callbacks instead.
Methods
__init__
([default_callbacks])Initializes the decorator.