mpcrl.core.callbacks.CallbackMixin#
- class mpcrl.core.callbacks.CallbackMixin[source]#
Bases:
objectA class with the particular purpose of creating, storing and deleting hooks attached to callbacks.
Notes
A particular note must be included about the __setstate__ method. When this method is used (e.g., via
copy.deepcopy), the hooks are not copied from the old copy. The reason is that the old copy/state’s hooks are likely to be pointing to methods belonging to old objects’ instances. Of course, this is an issue, because if the old hooks are used, the new object (created from the state) would reference callbacks belonging to the old object. For this reasons, hooks are not copied; instead, the method_establish_callback_hooksis automatically called to re-establish these, but with respect to the new object(s).Methods