diff options
author | Victor Stinner <vstinner@python.org> | 2020-04-29 01:28:46 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-29 01:28:46 (GMT) |
commit | 703647732359200c54f1d2e695cc3a06b9a96c9a (patch) | |
tree | f0ccd7a79f270fe9d7c3cba896461f3f7528131b /Doc | |
parent | 66abe98a816de84f89e2de4aa78cf09056227c25 (diff) | |
download | cpython-703647732359200c54f1d2e695cc3a06b9a96c9a.zip cpython-703647732359200c54f1d2e695cc3a06b9a96c9a.tar.gz cpython-703647732359200c54f1d2e695cc3a06b9a96c9a.tar.bz2 |
bpo-40421: Add PyFrame_GetBack() function (GH-19765)
New PyFrame_GetBack() function: get the frame next outer frame.
Replace frame->f_back with PyFrame_GetBack(frame) in most code but
frameobject.c, ceval.c and genobject.c.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/c-api/reflection.rst | 11 | ||||
-rw-r--r-- | Doc/whatsnew/3.9.rst | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/Doc/c-api/reflection.rst b/Doc/c-api/reflection.rst index 21d9878..9207d86 100644 --- a/Doc/c-api/reflection.rst +++ b/Doc/c-api/reflection.rst @@ -31,6 +31,17 @@ Reflection See also :c:func:`PyThreadState_GetFrame`. +.. c:function:: int PyFrame_GetBack(PyFrameObject *frame) + + Get the *frame* next outer frame. + + Return a strong reference, or ``NULL`` if *frame* has no outer frame. + + *frame* must not be ``NULL``. + + .. versionadded:: 3.9 + + .. c:function:: int PyFrame_GetCode(PyFrameObject *frame) Get the *frame* code. diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index e26bd47..0edb114 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -538,6 +538,7 @@ Build and C API Changes ======================= * New :c:func:`PyFrame_GetCode` function: get a frame code. + New :c:func:`PyFrame_GetBack` function: get the frame next outer frame. (Contributed by Victor Stinner in :issue:`40421`.) * Add :c:func:`PyFrame_GetLineNumber` to the limited C API. |