Интерфейс наблюдателя
This commit is contained in:
parent
af4dae63f5
commit
99daffa959
43
MininaVD/docs2/data2/visualizationObserver.ipynb
Normal file
43
MininaVD/docs2/data2/visualizationObserver.ipynb
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
{
|
||||||
|
"cells": [
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "8998420f-2c73-4f8a-a102-cc403777f3e9",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"from abc import ABC, abstractmethod\n",
|
||||||
|
"\n",
|
||||||
|
"class Observer(ABC):\n",
|
||||||
|
" \"\"\"Интерфейс наблюдателя (паттерн Observer).\"\"\"\n",
|
||||||
|
" \n",
|
||||||
|
" @abstractmethod\n",
|
||||||
|
" def update(self, event: str) -> None:\n",
|
||||||
|
" \"\"\"Обработчик события.\"\"\"\n",
|
||||||
|
" pass"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"kernelspec": {
|
||||||
|
"display_name": "Python [conda env:base] *",
|
||||||
|
"language": "python",
|
||||||
|
"name": "conda-base-py"
|
||||||
|
},
|
||||||
|
"language_info": {
|
||||||
|
"codemirror_mode": {
|
||||||
|
"name": "ipython",
|
||||||
|
"version": 3
|
||||||
|
},
|
||||||
|
"file_extension": ".py",
|
||||||
|
"mimetype": "text/x-python",
|
||||||
|
"name": "python",
|
||||||
|
"nbconvert_exporter": "python",
|
||||||
|
"pygments_lexer": "ipython3",
|
||||||
|
"version": "3.13.9"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nbformat": 4,
|
||||||
|
"nbformat_minor": 5
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user