GH-96793: Change `FOR_ITER` to not pop the iterator on exhaustion. by markshannon · Pull Request #96801 · python/cpython · GitHub

github.com

Tin mới

faster-cpython:for-iter-no-pop

GitHub CopilotWrite better code with AI

GitHub Copilot appDirect agents from issue to merge

ActionsAutomate any workflow

CodespacesInstant dev environments

IssuesPlan and track work

Code ReviewManage code changes

Code QualityEnforce quality at merge

GitHub Advanced SecurityFind and fix vulnerabilities

Code securitySecure your code as you build

Secret protectionStop leaks before they start

View all use cases

Financial services

View all industries

Software Development

GitHub SponsorsFund open source developers

Copilot for BusinessEnterprise-grade AI features

Premium SupportEnterprise-grade 24/7 support

Pull requests 2.6k

Security and quality 0

Enable specialization of iteration over generators, for gen():, and awaiting coroutines, await coro() #96793

Modify FOR_ITER to leave iterator on stack. Work in progress.

Document change to FOR_ITER.

Merge branch 'main' into for-iter-no-pop

awaiting core review

awaiting core review

Skip over POP_TOP at end of loop in specialized versions of FOR_ITER.

Merge branch 'main' into for-iter-no-pop

Fix up new POP_TOPs to have no location.

View reviewed changes

Learn more about hiding disruptive comments

The reason will be displayed to describe this comment to others. Learn more.

faster-cpython/ideas#457 (comment)

Merge branch 'main' into for-iter-no-pop

Add END_FOR instruction

Fix up specialization of FOR_ITER

Add END_FOR to docs.

View reviewed changes

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x RHEL7 3.x has failed when building commit 22863df.

to not pop the iterator on exhausti…

Further optimize FOR_ITER tekknolagi/skybison#508

[SOT][3.12] replace POP_JUMP_{BACKWARD,FORWARD}_IF_{TRUE,FALSE} to POP_JUMP_IF_{TRUE,FALSE} PaddlePaddle/Paddle#62155