[mypy] type Hook.events
authorLaurent Peuch <cortex@worlddomination.be>
Thu, 19 Dec 2019 06:35:19 +0100
changeset 12832 7d3299d6e655
parent 12831 b1ef9690f357
child 12833 c69421aece24
[mypy] type Hook.events
cubicweb/server/hook.py
--- a/cubicweb/server/hook.py	Thu Dec 19 06:33:49 2019 +0100
+++ b/cubicweb/server/hook.py	Thu Dec 19 06:35:19 2019 +0100
@@ -248,6 +248,7 @@
 
 from logging import getLogger
 from itertools import chain
+from typing import Union, Tuple
 
 from logilab.common.decorators import classproperty, cached
 from logilab.common.logging_ext import set_log_methods
@@ -521,8 +522,8 @@
     """
     __select__ = enabled_category()
     # set this in derivated classes
-    events = None
     category = None
+    events: Union[None, Tuple[str], Tuple[str, str]] = None
     order = 0
     # stop pylint from complaining about missing attributes in Hooks classes
     eidfrom = eidto = entity = rtype = repo = None