]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
ioloop: add_timeout() and call_at() take any Callable 3035/head
authorPierce Lopez <pierce.lopez@gmail.com>
Mon, 31 May 2021 21:55:06 +0000 (17:55 -0400)
committerPierce Lopez <pierce.lopez@gmail.com>
Mon, 31 May 2021 22:03:01 +0000 (18:03 -0400)
clean-up some methods that were missed in
https://github.com/tornadoweb/tornado/pull/2924

tornado/ioloop.py
tornado/platform/asyncio.py

index 28d86f5049d625a5a5178537c34d8c5b236f25b1..6fa7d87d59f2a6b2c8b395e650e01f52f76ebb4f 100644 (file)
@@ -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:
index 5e9c776d02ef00b8e9de8d901438e38a00a89716..31c949aed62e1656b5e2409ceedf46ad11eaf90a 100644 (file)
@@ -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