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-96803: Document and test new unstable internal frame API functions #104211

Merged
merged 9 commits into from
May 18, 2023
34 changes: 34 additions & 0 deletions Doc/c-api/frame.rst
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,37 @@ See also :ref:`Reflection <reflection>`.
.. c:function:: int PyFrame_GetLineNumber(PyFrameObject *frame)

Return the line number that *frame* is currently executing.



Internal Frames
---------------

Unless using PEP 523, you will not need this.
markshannon marked this conversation as resolved.
Show resolved Hide resolved

.. c:type:: struct _PyInterpreterFrame
AA-Turner marked this conversation as resolved.
Show resolved Hide resolved

The interpreter's internal frame representation.

markshannon marked this conversation as resolved.
Show resolved Hide resolved

.. c:function:: PyCodeObject* PyUnstable_InterpreterFrame_GetCode(struct _PyInterpreterFrame *frame);

Return a :term:`strong reference` to the code object for the frame.

.. versionadded:: 3.12


.. c:function:: int PyUnstable_InterpreterFrame_GetLasti(struct _PyInterpreterFrame *frame);

Return the byte offset into the last executed instruction.

.. versionadded:: 3.12


.. c:function:: int PyUnstable_InterpreterFrame_GetLine(struct _PyInterpreterFrame *frame);

Return the currently executing line number, or -1 if there is no line number.
markshannon marked this conversation as resolved.
Show resolved Hide resolved

.. versionadded:: 3.12