diff --git a/sanic/signals.py b/sanic/signals.py index 1ca22c32..46dbbf17 100644 --- a/sanic/signals.py +++ b/sanic/signals.py @@ -277,12 +277,18 @@ class SignalRouter(BaseRouter): return cast(Signal, signal) - def finalize(self, do_compile: bool = True, do_optimize: bool = False, loop: asyncio.AbstractEventLoop = None): + def finalize( + self, + do_compile: bool = True, + do_optimize: bool = False, + loop: Optional[asyncio.AbstractEventLoop] = None, + ): """Finalize the router and compile the routes Args: do_compile (bool, optional): Whether to compile the routes. Defaults to `True`. do_optimize (bool, optional): Whether to optimize the routes. Defaults to `False`. + loop (asyncio.AbstractEventLoop, optional): Event loop override for asyncio.get_running_loop(). Returns: SignalRouter: The router