summaryrefslogtreecommitdiff
path: root/poezio/timed_events.py
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-08-15 15:51:31 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-08-15 15:51:31 +0200
commita6c5ac486b31911aeadc1bbdaa58f95350a88952 (patch)
tree0c021058286d610e4f6436f46746dde702c882ee /poezio/timed_events.py
parentedbbf759cef6784b3d19d04250c7c37d496b4474 (diff)
downloadpoezio-a6c5ac486b31911aeadc1bbdaa58f95350a88952.tar.gz
poezio-a6c5ac486b31911aeadc1bbdaa58f95350a88952.tar.bz2
poezio-a6c5ac486b31911aeadc1bbdaa58f95350a88952.tar.xz
poezio-a6c5ac486b31911aeadc1bbdaa58f95350a88952.zip
Type DelayedEvent, also in Core.
Diffstat (limited to 'poezio/timed_events.py')
-rw-r--r--poezio/timed_events.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/poezio/timed_events.py b/poezio/timed_events.py
index f5b87f3c..cd7659e2 100644
--- a/poezio/timed_events.py
+++ b/poezio/timed_events.py
@@ -13,7 +13,8 @@ Once created, they must be added to the list of checked events with
"""
from datetime import datetime
-from typing import Callable, Union
+from asyncio import Handle
+from typing import Callable, Union, Optional, Tuple, Any
class DelayedEvent:
@@ -31,11 +32,11 @@ class DelayedEvent:
:param function callback: The handler that will be executed.
:param args: Optional arguments passed to the handler.
"""
- self.callback = callback
- self.args = args
- self.delay = delay
+ self.callback = callback # type: Callable
+ self.args = args # type: Tuple[Any, ...]
+ self.delay = delay # type: Union[int, float]
# An asyncio handler, as returned by call_later() or call_at()
- self.handler = None
+ self.handler = None # type: Optional[Handle]
class TimedEvent(DelayedEvent):