typePyFrameObject
Part of the
(as an opaque struct).The C structure of the objects used to describe frame objects.
There are no public members in this structure.
Changed in version 3.11: The members of this structure were removed from the public C API. Refer to the
for details.
The
and
functions can be used to get a frame object.
See also
.
PyFrame_Type
The type of frame objects. It is the same object as
in the Python layer.
Changed in version 3.11: Previously, this type was only available after including <frameobject.h>.
intPyFrame_Check(
*obj)
Return non-zero if obj is a frame object.
Changed in version 3.11: Previously, this function was only available after including <frameobject.h>.
*PyFrame_GetBack(
*frame)
Get the frame next outer frame.
Return a
, or NULL if frame has no outer frame.
New in version 3.9.
*PyFrame_GetBuiltins(
*frame)
Get the frame’s
attribute.
Return a
. The result cannot be NULL.
New in version 3.11.
*PyFrame_GetCode(
*frame)
Part of the
since version 3.10.Get the frame code.
Return a
.
The result (frame code) cannot be NULL.
New in version 3.9.
*PyFrame_GetGenerator(
*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
, or NULL.
New in version 3.11.
*PyFrame_GetGlobals(
*frame)
Get the frame’s
attribute.
Return a
. The result cannot be NULL.
New in version 3.11.
intPyFrame_GetLasti(
*frame)
Get the frame’s
attribute.
Returns -1 if frame.f_lasti is None.
New in version 3.11.
*PyFrame_GetLocals(
*frame)
Get the frame’s
attribute (
).
Return a
.
New in version 3.11.
intPyFrame_GetLineNumber(
*frame)
Part of the
since version 3.10.Return the line number that frame is currently executing.