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-130931: Add PyFrame_SetBack() function #131252

Closed
wants to merge 1 commit into from

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Mar 14, 2025

Add tests on PyFrame_GetBack() and PyFrame_SetBack().


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

Add tests on PyFrame_GetBack() and PyFrame_SetBack().
@vstinner
Copy link
Member Author

The coroutine support then needs to inject frames into the current stack. For this, we currently read and write f_back:
https://github.com/cython/cython/blob/f193ba860b94a7139cffd8b0d11b7ef977aa10d3/Cython/Utility/Coroutine.c#L784-L831
https://github.com/cython/cython/blob/f193ba860b94a7139cffd8b0d11b7ef977aa10d3/Cython/Utility/Coroutine.c#L870-L897

@da-woods: Would this function PyFrame_SetBack() be useful to Cython?

@vstinner
Copy link
Member Author

cc @markshannon

@da-woods
Copy link
Contributor

It'd work for us for our coroutine usage, but from what Mark said, it sounds like there might be issues exposing it more generally.

@vstinner
Copy link
Member Author

vstinner commented Mar 20, 2025

@markshannon is against this API: #130931 (comment). So I prefer to close my PR.

@vstinner vstinner closed this Mar 20, 2025
@vstinner vstinner deleted the frame_setback branch March 20, 2025 11:26
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.

2 participants