fsl.utils.weakfuncref

This module provides the WeakFunctionRef class.

class fsl.utils.weakfuncref.WeakFunctionRef(func)[source]

Bases: object

Class which encapsulates a weakref to a function or method.

This class is used by Notifier instances to reference listeners which have been registered to be notified of property value or attribute changes.

__init__(func)[source]

Create a new WeakFunctionRef to encapsulate the given function or bound/unbound method.

__str__()[source]

Return a string representation of the function.

__dict__ = mappingproxy({'__module__': 'fsl.utils.weakfuncref', '__doc__': 'Class which encapsulates a :mod:`weakref` to a function or method.\n\n    This class is used by :class:`.Notifier` instances to reference\n    listeners which have been registered to be notified of property value\n    or attribute changes.\n    ', '__init__': <function WeakFunctionRef.__init__>, '__str__': <function WeakFunctionRef.__str__>, '__repr__': <function WeakFunctionRef.__repr__>, '_WeakFunctionRef__findPrivateMethod': <function WeakFunctionRef.__findPrivateMethod>, '__call__': <function WeakFunctionRef.__call__>, 'function': <function WeakFunctionRef.function>, '__dict__': <attribute '__dict__' of 'WeakFunctionRef' objects>, '__weakref__': <attribute '__weakref__' of 'WeakFunctionRef' objects>, '__annotations__': {}})
__module__ = 'fsl.utils.weakfuncref'
__repr__()[source]

Return a string representation of the function.

__weakref__

list of weak references to the object (if defined)

__findPrivateMethod()

Finds and returns the bound method associated with the encapsulated function.

__call__()[source]

See :meth:function.

function()[source]

Return a reference to the encapsulated function or method, or None if the function has been garbage collected.