]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Add overloads to gen.multi() (#3515) master
authorJR Heard <jrheard@cs.stanford.edu>
Wed, 2 Jul 2025 12:44:37 +0000 (05:44 -0700)
committerGitHub <noreply@github.com>
Wed, 2 Jul 2025 12:44:37 +0000 (08:44 -0400)
Add overloads to gen.multi(). Closes #3514.

tornado/gen.py

index 1ee8b60844cd45df313a44657a257d3e2cd866ad..7bfbaf012ce70ad434b4d342a477615bc748f039 100644 (file)
@@ -437,6 +437,20 @@ class WaitIterator:
         return self.next()
 
 
+@overload
+def multi(
+    children: Sequence[_Yieldable],
+    quiet_exceptions: Union[Type[Exception], Tuple[Type[Exception], ...]] = (),
+) -> Future[List]: ...
+
+
+@overload
+def multi(
+    children: Mapping[Any, _Yieldable],
+    quiet_exceptions: Union[Type[Exception], Tuple[Type[Exception], ...]] = (),
+) -> Future[Dict]: ...
+
+
 def multi(
     children: Union[Sequence[_Yieldable], Mapping[Any, _Yieldable]],
     quiet_exceptions: "Union[Type[Exception], Tuple[Type[Exception], ...]]" = (),