diff --git a/satella/coding/concurrent/callablegroup.py b/satella/coding/concurrent/callablegroup.py index 87053433a68b6e62e6f68208813a96743d5c999b..ecf3fd6ebd2f73ce4bde6e74b64cce60639f69e7 100644 --- a/satella/coding/concurrent/callablegroup.py +++ b/satella/coding/concurrent/callablegroup.py @@ -4,11 +4,10 @@ import time import typing as tp from satella.coding.deleters import DictDeleter -from satella.coding.structures.mixins import HashableMixin from satella.coding.typing import T, NoArgCallable -class CancellableCallback(HashableMixin): +class CancellableCallback: """ A callback that you can cancel. @@ -36,6 +35,12 @@ class CancellableCallback(HashableMixin): self.callback_fun = callback_fun self.cancelled = False + def __hash__(self): + return hash(self.id) + + def __eq__(self, other) -> bool: + return hash(self) == hash(other) + def __call__(self, *args, **kwargs): if not self.cancelled: return self.callback_fun(*args, **kwargs)