From e6e31d0a99c0837931988ddef690a08d2897c48a Mon Sep 17 00:00:00 2001 From: Eelke van den Bos Date: Wed, 27 Sep 2023 09:24:16 -0400 Subject: [PATCH] Add docblock, fix formatting, fix implicit optional typing --- sanic/signals.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sanic/signals.py b/sanic/signals.py index 1ca22c32d5..46dbbf1723 100644 --- a/sanic/signals.py +++ b/sanic/signals.py @@ -277,12 +277,18 @@ def add( # type: ignore 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