]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Add overloads to gen.multi() (#3515)
authorJR Heard <jrheard@cs.stanford.edu>
Wed, 2 Jul 2025 12:44:37 +0000 (05:44 -0700)
committerBen Darnell <ben@bendarnell.com>
Thu, 7 Aug 2025 20:43:43 +0000 (16:43 -0400)
Add overloads to gen.multi(). Closes #3514.

tornado/gen.py

index 3dab733c6a9925214889f0b29862634d31a5cd02..01e7f8a06fac209ea5f273d2246eb2cad8331969 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], ...]]" = (),