]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-77714: Provide an async iterator version of as_completed (GH-22491)
authorJustin Turner Arthur <justinarthur@gmail.com>
Mon, 1 Apr 2024 17:07:29 +0000 (12:07 -0500)
committerGitHub <noreply@github.com>
Mon, 1 Apr 2024 17:07:29 +0000 (20:07 +0300)
commitc741ad3537193c63fe697a8f0316aecd45eeb9ba
tree4dc0eaac7cde2150ee10811779f1f62177524dc3
parentddf814db744006e0f42328aa15ace97c9d8ad681
gh-77714: Provide an async iterator version of as_completed (GH-22491)

* as_completed returns object that is both iterator and async iterator
* Existing tests adjusted to test both the old and new style
* New test to ensure iterator can be resumed
* New test to ensure async iterator yields any passed-in Futures as-is

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
Doc/library/asyncio-task.rst
Doc/whatsnew/3.13.rst
Lib/asyncio/tasks.py
Lib/test/test_asyncio/test_tasks.py
Misc/NEWS.d/next/Library/2020-10-02-17-35-19.bpo-33533.GLIhM5.rst [new file with mode: 0644]