From 275416abc099f81e74a55e56dacfe687505ce624 Mon Sep 17 00:00:00 2001 From: darksidecat <58224121+darksidecat@users.noreply.github.com> Date: Sun, 26 Jun 2022 12:26:02 +0300 Subject: [PATCH] Update aiogram/dispatcher/fsm/state.py Co-authored-by: Oleg A. --- aiogram/dispatcher/fsm/state.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/aiogram/dispatcher/fsm/state.py b/aiogram/dispatcher/fsm/state.py index 8431d744..8cec3ac4 100644 --- a/aiogram/dispatcher/fsm/state.py +++ b/aiogram/dispatcher/fsm/state.py @@ -54,8 +54,11 @@ class State: return True return raw_state == self.state - def __copy__(self) -> "State": - return self + def __eq__(self, other): + return self.state == other.state + + def __hash__(self): + return hash(self.state) def __deepcopy__(self, memo: Dict[int, "State"]) -> "State": memo[id(self)] = self