design-patterns/behavioral/observer/observer.py
Ruidy c8cc1f47b8
Observer (#20)
* doc: create package & update general TOCs

* doc: add documentation

* add code example

* reformat using black
2020-10-06 08:25:18 +02:00

16 lines
337 B
Python

from abc import ABC, abstractmethod
from structural.proxy.subject import Subject
class Observer(ABC):
"""
The Observer interface declares the update method, used by subjects.
"""
@abstractmethod
def update(self, subject: Subject) -> None:
"""
Receive update from subject.
"""
pass