From 9b349f8cc0435a17d333819207f238a12295bf7e Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 29 Oct 2019 18:00:59 +0000 Subject: [PATCH] move typing.Callable def so Event doesn't have to be in " " --- src/EventManager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EventManager.py b/src/EventManager.py index 7acd98f9..46ea3ed7 100644 --- a/src/EventManager.py +++ b/src/EventManager.py @@ -11,8 +11,6 @@ DEFAULT_PRIORITY = PRIORITY_MEDIUM DEFAULT_EVENT_DELIMITER = "." DEFAULT_MULTI_DELIMITER = "|" -CALLBACK_TYPE = typing.Callable[["Event"], typing.Any] - class Event(object): def __init__(self, name: str, kwargs): self.name = name @@ -27,6 +25,8 @@ class Event(object): def eat(self): self.eaten = True +CALLBACK_TYPE = typing.Callable[[Event], typing.Any] + class EventHook(object): def __init__(self, event_name: str, func: CALLBACK_TYPE, context: typing.Optional[str], priority: int,