ops needs to check for subclass, not instance

This commit is contained in:
əlemi 2021-12-17 13:53:07 +01:00
parent 1377e04d16
commit 687e22ac5e

View file

@ -17,7 +17,7 @@ class CallbacksHolder:
self._tasks = {} self._tasks = {}
def callback_keys(self, filter:Type = None) -> Set[Any]: def callback_keys(self, filter:Type = None) -> Set[Any]:
return set(x for x in self._callbacks.keys() if not filter or isinstance(x, filter)) return set(x for x in self._callbacks.keys() if not filter or issubclass(x, filter))
def register(self, key:Any, callback:Callable): def register(self, key:Any, callback:Callable):
if key not in self._callbacks: if key not in self._callbacks: