Navigation
- index
- modules |
- next |
- previous |
- Python »
- 3.10.22 Documentation »
- Python/C API Reference Manual »
- Utilities »
- Reflection
- |
- Theme |
Reflection¶
-
PyObject *
PyEval_GetBuiltins(void)¶ - Return value: Borrowed reference. Part of the Stable ABI.
Return a dictionary of the builtins in the current execution frame, or the interpreter of the thread state if no frame is currently executing.
-
PyObject *
PyEval_GetLocals(void)¶ - Return value: Borrowed reference. Part of the Stable ABI.
Return a dictionary of the local variables in the current execution frame, or
NULLif no frame is currently executing.
-
PyObject *
PyEval_GetGlobals(void)¶ - Return value: Borrowed reference. Part of the Stable ABI.
Return a dictionary of the global variables in the current execution frame, or
NULLif no frame is currently executing.
-
PyFrameObject *
PyEval_GetFrame(void)¶ - Return value: Borrowed reference. Part of the Stable ABI.
Return the current thread state’s frame, which is
NULLif no frame is currently executing.See also
PyThreadState_GetFrame().
-
PyFrameObject *
PyFrame_GetBack(PyFrameObject *frame)¶ Get the frame next outer frame.
Return a strong reference, or
NULLif frame has no outer frame.frame must not be
NULL.New in version 3.9.
-
PyCodeObject *
PyFrame_GetCode(PyFrameObject *frame)¶ - Part of the Stable ABI since version 3.10.
Get the frame code.
Return a strong reference.
frame must not be
NULL. The result (frame code) cannot beNULL.New in version 3.9.
-
int
PyFrame_GetLineNumber(PyFrameObject *frame)¶ - Part of the Stable ABI since version 3.10.
Return the line number that frame is currently executing.
frame must not be
NULL.
-
const char *
PyEval_GetFuncName(PyObject *func)¶ - Part of the Stable ABI.
Return the name of func if it is a function, class or instance object, else the name of funcs type.
-
const char *
PyEval_GetFuncDesc(PyObject *func)¶ - Part of the Stable ABI.
Return a description string, depending on the type of func. Return values include “()” for functions and methods, ” constructor”, ” instance”, and ” object”. Concatenated with the result of
PyEval_GetFuncName(), the result will be a description of func.
Previous topic
String conversion and formatting
Next topic
Codec registry and support functions
This Page
Navigation
- index
- modules |
- next |
- previous |
- Python »
- 3.10.22 Documentation »
- Python/C API Reference Manual »
- Utilities »
- Reflection
- |
- Theme |
This page is licensed under the Python Software Foundation License Version 2.
Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License.
See History and License for more information.
The Python Software Foundation is a non-profit corporation. Please donate.
Last updated on Oct 11, 2026. Found a bug?
Created using Sphinx 3.4.3.