GH-90997: Wrap `yield from`/`await` in a virtual `try`/`except StopIteration` by brandtbucher · Pull Request #96010 · python/cpython · GitHub

github.com

Tin mới

brandtbucher:gen-throw-new

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

Inline bytecode caches #90997

Use a virtual try/except to handle close()/throw()

Catch up with main

Don't load StopIteration as a constant

Clean up control flow a bit

Catch up with main

Improve docs for SEND

awaiting core review

awaiting core review

bpo-46841: Don't jump during throw() #31968

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#448

This adds a lot of bulk to the bytecode. Take this minimal function:

mostly-but-not-quite working THROW branch

Yeah, like I said in the meetings: this about triples the size of the bytecode (all in the cold path, though). If all we care about here is the literal size of the bytecode, then we can pack everything in the exception h

Pack everything into END_THROW

Catch up with main

View reviewed changes

Feedback from code review