Skip to content

gh-158004: Preserve as_completed items after anext cancellation - #158005

Merged
kumaraditya303 merged 5 commits into
python:mainfrom
lpyu001:asyncio-c
Oct 20, 2026
Merged

kumaraditya303 merged 5 commits into
python:mainfrom
lpyu001:asyncio-c

Conversation

@lpyu001

@lpyu001 lpyu001 commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Restore the iterator's remaining-item count when a pending asynchronous iteration step is cancelled.

Restore the iterator's remaining-item count when a pending asynchronous
iteration step is cancelled.
Comment thread Lib/asyncio/tasks.py Outdated
Comment thread Lib/asyncio/tasks.py Outdated
@lpyu001

lpyu001 commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

ok, thanks :)

@kumaraditya303
kumaraditya303 merged commit 4b33a9d into python:main Oct 20, 2026
53 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @lpyu001 for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

@bedevere-app

bedevere-app Bot commented Oct 20, 2026

Copy link
Copy Markdown

GH-159877 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Oct 20, 2026
@bedevere-app

bedevere-app Bot commented Oct 20, 2026

Copy link
Copy Markdown

GH-159878 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Oct 20, 2026
kumaraditya303 added a commit that referenced this pull request Oct 20, 2026
… cancellation (GH-158005) (#159878)

gh-158004: preserve `asyncio.as_completed()` items after anext cancellation (GH-158005)
(cherry picked from commit 4b33a9d)

Co-authored-by: Pengyu Lee <lipengyu@kylinos.cn>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
kumaraditya303 added a commit that referenced this pull request Oct 20, 2026
… cancellation (GH-158005) (#159877)

gh-158004: preserve `asyncio.as_completed()` items after anext cancellation (GH-158005)
(cherry picked from commit 4b33a9d)

Co-authored-by: Pengyu Lee <lipengyu@kylinos.cn>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants