| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…ction Add also PyUnstable_InterpreterFrame type.
|
See #141665 (review) for the rationale on adding this function. |
Sorry, something went wrong.
Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
|
I don't think we should add PyUnstable_InterpreterFrame_GetFrameObject(). If someone wants a frame object, they can get it directly with sys._getframe() or the C API equivalent. |
Sorry, something went wrong.
|
Well, @encukou requested such API for PyUnstable_InterpreterState_SetEvalFrameFunc(): #141665 (review) |
Sorry, something went wrong.
|
sys._getframe() won't work in a frame evaluation function -- until the new frame is set up, it returns the previous one. Should it be PyUnstable_InterpreterFrame_AsFrameObject? |
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
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. |
Sorry, something went wrong.
|
The C API Working Group decided to not add a public function for this feature, but keep the _Py name instead: capi-workgroup/decisions#89. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Add also PyUnstable_InterpreterFrame type.
📚 Documentation preview 📚: https://cpython-previews--141950.org.readthedocs.build/