Helper Module for Deep Learning.
Observable pattern implementation.
-
class
pynet.observable.Observable(signals)[source]¶ Base class for observable classes.
This class defines a simple interface to add or remove observers on an object.
-
__init__(signals)[source]¶ Initilize the Observable class.
- Parameters
signals: list of str
the allowed signals.
-
add_observer(signal, observer)[source]¶ Add an observer to the object. Raise an exception if the signal is not allowed.
- Parameters
signal: str
a valid signal.
observer: @func
a function that will be called when the signal is emitted.
-
property
allowed_signals¶ Events allowed for the current object.
-
Follow us
© 2019, pynet developers .
Inspired by AZMIND template.
Inspired by AZMIND template.