From ad1c4d5bff13db7cfd49f5dc07128782e3ea00e6 Mon Sep 17 00:00:00 2001 From: Pierce Lopez Date: Mon, 31 May 2021 17:55:06 -0400 Subject: [PATCH] ioloop: add_timeout() and call_at() take any Callable clean-up some methods that were missed in https://github.com/tornadoweb/tornado/pull/2924 --- tornado/ioloop.py | 2 +- tornado/platform/asyncio.py | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/tornado/ioloop.py b/tornado/ioloop.py index 28d86f504..6fa7d87d5 100644 --- a/tornado/ioloop.py +++ b/tornado/ioloop.py @@ -547,7 +547,7 @@ class IOLoop(Configurable): def add_timeout( self, deadline: Union[float, datetime.timedelta], - callback: Callable[..., Optional[Awaitable]], + callback: Callable, *args: Any, **kwargs: Any ) -> object: diff --git a/tornado/platform/asyncio.py b/tornado/platform/asyncio.py index 5e9c776d0..31c949aed 100644 --- a/tornado/platform/asyncio.py +++ b/tornado/platform/asyncio.py @@ -204,11 +204,7 @@ class BaseAsyncIOLoop(IOLoop): self.asyncio_loop.stop() def call_at( - self, - when: float, - callback: Callable[..., Optional[Awaitable]], - *args: Any, - **kwargs: Any + self, when: float, callback: Callable, *args: Any, **kwargs: Any ) -> object: # asyncio.call_at supports *args but not **kwargs, so bind them here. # We do not synchronize self.time and asyncio_loop.time, so -- 2.47.2