summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-04-01 08:55:00 (GMT)
committerGitHub <noreply@github.com>2022-04-01 08:55:00 (GMT)
commitf877b40e3f7e0d97878884d80fbec879a85ab7e8 (patch)
tree13a96fd70e9ccecd730d5cdd3c52b1303645f23b /Doc
parentb9a5522dd952125a99ff554f01f311cae25f5a91 (diff)
downloadcpython-f877b40e3f7e0d97878884d80fbec879a85ab7e8.zip
cpython-f877b40e3f7e0d97878884d80fbec879a85ab7e8.tar.gz
cpython-f877b40e3f7e0d97878884d80fbec879a85ab7e8.tar.bz2
bpo-46850: Move _PyInterpreterState_SetEvalFrameFunc() to internal C API (GH-32054)
Move the private _PyFrameEvalFunction type, and private _PyInterpreterState_GetEvalFrameFunc() and _PyInterpreterState_SetEvalFrameFunc() functions to the internal C API. The _PyFrameEvalFunction callback function type now uses the _PyInterpreterFrame type which is part of the internal C API. Update the _PyFrameEvalFunction documentation.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/c-api/init.rst11
-rw-r--r--Doc/whatsnew/3.11.rst6
2 files changed, 16 insertions, 1 deletions
diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst
index 322b9e4..152d4c8 100644
--- a/Doc/c-api/init.rst
+++ b/Doc/c-api/init.rst
@@ -1228,18 +1228,25 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
.. versionadded:: 3.8
-.. c:type:: PyObject* (*_PyFrameEvalFunction)(PyThreadState *tstate, PyFrameObject *frame, int throwflag)
+.. c:type:: PyObject* (*_PyFrameEvalFunction)(PyThreadState *tstate, _PyInterpreterFrame *frame, int throwflag)
+
+ Internal C API.
Type of a frame evaluation function.
The *throwflag* parameter is used by the ``throw()`` method of generators:
if non-zero, handle the current exception.
+ .. versionchanged:: 3.11
+ The second parameter type becomes ``_PyInterpreterFrame``.
+
.. versionchanged:: 3.9
The function now takes a *tstate* parameter.
.. c:function:: _PyFrameEvalFunction _PyInterpreterState_GetEvalFrameFunc(PyInterpreterState *interp)
+ Internal C API.
+
Get the frame evaluation function.
See the :pep:`523` "Adding a frame evaluation API to CPython".
@@ -1248,6 +1255,8 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
.. c:function:: void _PyInterpreterState_SetEvalFrameFunc(PyInterpreterState *interp, _PyFrameEvalFunction eval_frame)
+ Internal C API.
+
Set the frame evaluation function.
See the :pep:`523` "Adding a frame evaluation API to CPython".
diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst
index 15f765d..1580867 100644
--- a/Doc/whatsnew/3.11.rst
+++ b/Doc/whatsnew/3.11.rst
@@ -1102,6 +1102,12 @@ Porting to Python 3.11
is part of the internal C API.
(Contributed by Victor Stinner in :issue:`46850`.)
+* Move the private ``_PyFrameEvalFunction`` type, and private
+ ``_PyInterpreterState_GetEvalFrameFunc()`` and
+ ``_PyInterpreterState_SetEvalFrameFunc()`` functions to the internal C API.
+ The ``_PyFrameEvalFunction`` callback function type now uses the
+ ``_PyInterpreterFrame`` type which is part of the internal C API.
+ (Contributed by Victor Stinner in :issue:`46850`.)
Deprecated
----------