summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/frame.rst
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2022-03-31 16:13:25 (GMT)
committerGitHub <noreply@github.com>2022-03-31 16:13:25 (GMT)
commit74b95d86e0f14603f878c4df3133bc8a93f8f80a (patch)
treebdd3f8b2a671bfa2458c1a4e34098ff70fa6e36b /Doc/c-api/frame.rst
parent44e915028d75f7cef141aa1aada962465a5907d6 (diff)
downloadcpython-74b95d86e0f14603f878c4df3133bc8a93f8f80a.zip
cpython-74b95d86e0f14603f878c4df3133bc8a93f8f80a.tar.gz
cpython-74b95d86e0f14603f878c4df3133bc8a93f8f80a.tar.bz2
bpo-40421: Add missing getters for frame object attributes to C-API. (GH-32114)
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 0c11bc1..6d265e4 100644
--- a/Doc/c-api/frame.rst
+++ b/Doc/c-api/frame.rst
@@ -30,6 +30,17 @@ See also :ref:`Reflection <reflection>`.
.. versionadded:: 3.9
+.. c:function:: PyObject* PyFrame_GetBuiltins(PyFrameObject *frame)
+
+ Get the *frame*'s ``f_builtins`` attribute.
+
+ Return a :term:`strong reference`. The result cannot be ``NULL``.
+
+ *frame* must not be ``NULL``.
+
+ .. versionadded:: 3.11
+
+
.. c:function:: PyCodeObject* PyFrame_GetCode(PyFrameObject *frame)
Get the *frame* code.
@@ -41,6 +52,30 @@ See also :ref:`Reflection <reflection>`.
.. versionadded:: 3.9
+.. c:function:: PyObject* PyFrame_GetGenerator(PyFrameObject *frame)
+
+ Get the generator, coroutine, or async generator that owns this frame,
+ or ``NULL`` if this frame is not owned by a generator.
+ Does not raise an exception, even if the return value is ``NULL``.
+
+ Return a :term:`strong reference`, or ``NULL``.
+
+ *frame* must not be ``NULL``.
+
+ .. versionadded:: 3.11
+
+
+.. c:function:: PyObject* PyFrame_GetGlobals(PyFrameObject *frame)
+
+ Get the *frame*'s ``f_globals`` attribute.
+
+ Return a :term:`strong reference`. The result cannot be ``NULL``.
+
+ *frame* must not be ``NULL``.
+
+ .. versionadded:: 3.11
+
+
.. c:function:: PyObject* PyFrame_GetLocals(PyFrameObject *frame)
Get the *frame*'s ``f_locals`` attribute (:class:`dict`).