mirror of
https://github.com/rjNemo/design-patterns
synced 2026-06-06 02:26:40 +00:00
* doc: create package & update general TOCs * doc: add documentation * add code example * reformat using black
16 lines
337 B
Python
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
|