Skip to content

Commit

Permalink
Change last asyncio.gather() overload ret. to List
Browse files Browse the repository at this point in the history
Stems from PR python#1550/ Issue python#3243.
  • Loading branch information
bsolomon1124 committed Sep 20, 2019
1 parent 4d662f0 commit 2853cc9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion stdlib/3/asyncio/tasks.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ def ensure_future(coro_or_future: _FutureT[_T],
*, loop: Optional[AbstractEventLoop] = ...) -> Future[_T]: ...
# Prior to Python 3.7 'async' was an alias for 'ensure_future'.
# It became a keyword in 3.7.

# `gather()` actually returns a list with length equal to the number
# of tasks passed; however, Tuple is used similar to the annotation for
# zip() because typing does not support variadic type variables. See
# typing PR #1550 for discussion.
@overload
def gather(coro_or_future1: _FutureT[_T1],
*, loop: Optional[AbstractEventLoop] = ..., return_exceptions: bool = ...) -> Future[Tuple[_T1]]: ...
Expand All @@ -48,7 +53,7 @@ def gather(coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], coro_
def gather(coro_or_future1: _FutureT[Any], coro_or_future2: _FutureT[Any], coro_or_future3: _FutureT[Any],
coro_or_future4: _FutureT[Any], coro_or_future5: _FutureT[Any], coro_or_future6: _FutureT[Any],
*coros_or_futures: _FutureT[Any],
loop: Optional[AbstractEventLoop] = ..., return_exceptions: bool = ...) -> Future[Tuple[Any, ...]]: ...
loop: Optional[AbstractEventLoop] = ..., return_exceptions: bool = ...) -> Future[List[Any]]: ...
def run_coroutine_threadsafe(coro: _FutureT[_T],
loop: AbstractEventLoop) -> concurrent.futures.Future[_T]: ...
def shield(arg: _FutureT[_T], *, loop: Optional[AbstractEventLoop] = ...) -> Future[_T]: ...
Expand Down

0 comments on commit 2853cc9

Please sign in to comment.