tessella.observer package

Submodules

tessella.observer.observable module

class tessella.observer.observable.Observable[source]

Bases: object

A class representing an observable object that can notify registered listeners.

_listeners

A list storing callables listening to this object.

Type:

list[Callable]

notify_listeners()[source]

Notifies all registered listeners that something changed.

Return type:

None

tessella.observer.value_notifier module

class tessella.observer.value_notifier.ValueNotifier(variable)[source]

Bases: Observable, Generic[T]

A wrapper for a variable of type T that can notify listeners when its value is updated.

Parameters:

variable (T)

_value

Variable T to be observed.

Type:

T

_listeners

Inherited from Observable. A list of functions that should be called when the value of this variable is updated.

Type:

list[Callable[[None], None]]

property value: T

The current value of the observed variable.

Type:

T