2019-05-17 06:55:34 -03:00
|
|
|
.. highlight:: c
|
2008-01-20 05:30:57 -04:00
|
|
|
|
|
|
|
.. _reflection:
|
|
|
|
|
|
|
|
Reflection
|
|
|
|
==========
|
|
|
|
|
2020-03-20 11:51:45 -03:00
|
|
|
.. c:function:: PyObject* PyEval_GetBuiltins(void)
|
2008-01-20 05:30:57 -04:00
|
|
|
|
|
|
|
Return a dictionary of the builtins in the current execution frame,
|
|
|
|
or the interpreter of the thread state if no frame is currently executing.
|
|
|
|
|
|
|
|
|
2020-03-20 11:51:45 -03:00
|
|
|
.. c:function:: PyObject* PyEval_GetLocals(void)
|
2008-01-20 05:30:57 -04:00
|
|
|
|
|
|
|
Return a dictionary of the local variables in the current execution frame,
|
2019-10-30 07:03:20 -03:00
|
|
|
or ``NULL`` if no frame is currently executing.
|
2009-01-03 17:18:54 -04:00
|
|
|
|
2008-01-20 05:30:57 -04:00
|
|
|
|
2020-03-20 11:51:45 -03:00
|
|
|
.. c:function:: PyObject* PyEval_GetGlobals(void)
|
2008-01-20 05:30:57 -04:00
|
|
|
|
|
|
|
Return a dictionary of the global variables in the current execution frame,
|
2019-10-30 07:03:20 -03:00
|
|
|
or ``NULL`` if no frame is currently executing.
|
2008-01-20 05:30:57 -04:00
|
|
|
|
|
|
|
|
2020-03-20 11:51:45 -03:00
|
|
|
.. c:function:: PyFrameObject* PyEval_GetFrame(void)
|
2008-01-20 05:30:57 -04:00
|
|
|
|
2019-10-30 07:03:20 -03:00
|
|
|
Return the current thread state's frame, which is ``NULL`` if no frame is
|
2008-01-20 05:30:57 -04:00
|
|
|
currently executing.
|
|
|
|
|
2020-03-20 11:51:45 -03:00
|
|
|
See also :c:func:`PyThreadState_GetFrame`.
|
|
|
|
|
2008-01-20 05:30:57 -04:00
|
|
|
|
2010-10-06 07:11:56 -03:00
|
|
|
.. c:function:: const char* PyEval_GetFuncName(PyObject *func)
|
2008-01-20 05:30:57 -04:00
|
|
|
|
|
|
|
Return the name of *func* if it is a function, class or instance object, else the
|
|
|
|
name of *func*\s type.
|
|
|
|
|
|
|
|
|
2010-10-06 07:11:56 -03:00
|
|
|
.. c:function:: const char* PyEval_GetFuncDesc(PyObject *func)
|
2008-01-20 05:30:57 -04:00
|
|
|
|
|
|
|
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
|
2010-10-06 07:11:56 -03:00
|
|
|
:c:func:`PyEval_GetFuncName`, the result will be a description of
|
2008-01-20 05:30:57 -04:00
|
|
|
*func*.
|