summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/frame.rst
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2023-05-18 09:10:15 (GMT)
committerGitHub <noreply@github.com>2023-05-18 09:10:15 (GMT)
commitcfa517d5a68bae24cbe8d9fe6b8e0d4935e507d2 (patch)
treec25c67c7ba5b46b22884fc04f62b4429443c99e5 /Doc/c-api/frame.rst
parent68b5f08b72e02f62ec787bfbb7aa99bac661daec (diff)
downloadcpython-cfa517d5a68bae24cbe8d9fe6b8e0d4935e507d2.zip
cpython-cfa517d5a68bae24cbe8d9fe6b8e0d4935e507d2.tar.gz
cpython-cfa517d5a68bae24cbe8d9fe6b8e0d4935e507d2.tar.bz2
GH-96803: Document and test new unstable internal frame API functions (GH-104211)
Weaken contract of PyUnstable_InterpreterFrame_GetCode to return PyObject*.
Diffstat (limited to 'Doc/c-api/frame.rst')
-rw-r--r--Doc/c-api/frame.rst35
1 files changed, 35 insertions, 0 deletions
diff --git a/Doc/c-api/frame.rst b/Doc/c-api/frame.rst
index 1ac8f03..9f7addf 100644
--- a/Doc/c-api/frame.rst
+++ b/Doc/c-api/frame.rst
@@ -130,3 +130,38 @@ 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.
+
+.. c:struct:: _PyInterpreterFrame
+
+ The interpreter's internal frame representation.
+
+ .. versionadded:: 3.11
+
+.. c:function:: PyObject* 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.
+
+ .. versionadded:: 3.12
+
+