Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-111354: Simplify _PyGen_yf by moving some of its work to the compiler and frame state #111648

Merged
merged 2 commits into from
Nov 3, 2023

Conversation

iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented Nov 2, 2023

This splits the SUSPENDED frame state into SUSPENDED and SUSPENDED_YIELD_FROM, adds an oparg to YIELD_VALUE to indicate whether it's in a yield-from or await (so it can set the state correctly). With this, _PyGen_yf has a lot less work to do.


📚 Documentation preview 📚: https://cpython-previews--111648.org.readthedocs.build/

Copy link
Member

@markshannon markshannon left a comment

Choose a reason for hiding this comment

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

I'd like to avoid the extra branch in YIELD_VALUE.
Other than that, looks good.

Python/bytecodes.c Outdated Show resolved Hide resolved
Python/bytecodes.c Outdated Show resolved Hide resolved
@bedevere-app
Copy link

bedevere-app bot commented Nov 2, 2023

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

@iritkatriel
Copy link
Member Author

iritkatriel commented Nov 2, 2023

I have made the requested changes; please review again.

Copy link
Member

@markshannon markshannon left a comment

Choose a reason for hiding this comment

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

Looks good.

@iritkatriel iritkatriel merged commit d49aba5 into python:main Nov 3, 2023
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants