summaryrefslogtreecommitdiff
path: root/ch1p
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2021-12-10 19:04:14 +0300
committerEvgeny Zinoviev <me@ch1p.io>2021-12-10 19:04:14 +0300
commit6633b5abc13813ac3720b8269e4f498527d11372 (patch)
tree71d860dca386ad206afbf8671964345c65662f6f /ch1p
parent84e8b8afd6e168ae6e3fa2dd0a31e9566058240f (diff)
state: add __contains__
Diffstat (limited to 'ch1p')
-rw-r--r--ch1p/__init__.py2
-rw-r--r--ch1p/state.py5
2 files changed, 5 insertions, 2 deletions
diff --git a/ch1p/__init__.py b/ch1p/__init__.py
index 878f8fa..c5906d1 100644
--- a/ch1p/__init__.py
+++ b/ch1p/__init__.py
@@ -1,2 +1,2 @@
from .functions import telegram_notify
-from .state import State \ No newline at end of file
+from .state import State
diff --git a/ch1p/state.py b/ch1p/state.py
index 1ea2373..587b31c 100644
--- a/ch1p/state.py
+++ b/ch1p/state.py
@@ -39,6 +39,9 @@ class State:
def __setitem__(self, key, value):
self._data[key] = value
+ def __contains__(self, key):
+ return key in self._data
+
def __delitem__(self, key):
if key in self._data:
- del self._data[key] \ No newline at end of file
+ del self._data[key]