Skip to content

Commit 412b9e7

Browse files
bsolomon1124JelleZijlstra
authored andcommitted
Change last asyncio.gather() overload ret. to List (#3248)
Stems from PR #1550/ Issue #3243.
1 parent 468d13a commit 412b9e7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

stdlib/3/asyncio/tasks.pyi

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ def ensure_future(coro_or_future: _FutureT[_T],
3232
*, loop: Optional[AbstractEventLoop] = ...) -> Future[_T]: ...
3333
# Prior to Python 3.7 'async' was an alias for 'ensure_future'.
3434
# It became a keyword in 3.7.
35+
36+
# `gather()` actually returns a list with length equal to the number
37+
# of tasks passed; however, Tuple is used similar to the annotation for
38+
# zip() because typing does not support variadic type variables. See
39+
# typing PR #1550 for discussion.
3540
@overload
3641
def gather(coro_or_future1: _FutureT[_T1],
3742
*, loop: Optional[AbstractEventLoop] = ..., return_exceptions: Literal[False] = ...) -> Future[Tuple[_T1]]: ...
@@ -56,7 +61,7 @@ def gather(coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], coro_
5661
def gather(coro_or_future1: _FutureT[Any], coro_or_future2: _FutureT[Any], coro_or_future3: _FutureT[Any],
5762
coro_or_future4: _FutureT[Any], coro_or_future5: _FutureT[Any], coro_or_future6: _FutureT[Any],
5863
*coros_or_futures: _FutureT[Any],
59-
loop: Optional[AbstractEventLoop] = ..., return_exceptions: bool = ...) -> Future[Tuple[Any, ...]]: ...
64+
loop: Optional[AbstractEventLoop] = ..., return_exceptions: bool = ...) -> Future[List[Any]]: ...
6065
@overload
6166
def gather(coro_or_future1: _FutureT[_T1],
6267
*, loop: Optional[AbstractEventLoop] = ...,

0 commit comments

Comments
 (0)