Uh oh!
There was an error while loading. Please reload this page.
gh-141518: Add PyUnstable_InterpreterFrame_GetFrameObject() function - #141950
gh-141518: Add PyUnstable_InterpreterFrame_GetFrameObject() function#141950vstinner wants to merge 6 commits into
Conversation
…ction Add also PyUnstable_InterpreterFrame type.
vstinner
commented
Nov 25, 2025
See #141665 (review) for the rationale on adding this function. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
markshannon
commented
Dec 1, 2025
I don't think we should add If someone wants a frame object, they can get it directly with |
vstinner
commented
Dec 1, 2025
Well, @encukou requested such API for PyUnstable_InterpreterState_SetEvalFrameFunc(): #141665 (review) |
encukou
commented
Dec 2, 2025
Should it be |
markshannon
commented
Dec 2, 2025
In a frame evaluation function, you don't want the frame object. It is just a bulkier, slower version of the frame you already have. The frame object contains no additional information, just a pointer back to the internal frame. |
vstinner
commented
Dec 3, 2025
Yeah, you should use the internal C API to access the interpreter frame: pycore_interpframe.h provides many functions, such as:
I know that it's kind of unusual to have a public function to set a frame evalution function, but need the internal C API to implement it. |
vstinner
commented
Feb 10, 2026
The C API Working Group decided to not add a public function for this feature, but keep the |
Add also PyUnstable_InterpreterFrame type.
PyUnstable_InterpreterState_SetEvalFrameFunc()#141518📚 Documentation preview 📚: https://cpython-previews--141950.org.readthedocs.build/