反射¶
-
PyObject*
PyEval_GetBuiltins
()¶ - Return value: Borrowed reference.
返回当前执行帧中内置函数的字典,如果当前没有帧正在执行,则返回线程状态的解释器。
-
PyObject*
PyEval_GetLocals
()¶ - Return value: Borrowed reference.
Return a dictionary of the local variables in the current execution frame, or NULL if no frame is currently executing.
-
PyObject*
PyEval_GetGlobals
()¶ - Return value: Borrowed reference.
Return a dictionary of the global variables in the current execution frame, or NULL if no frame is currently executing.
-
PyFrameObject*
PyEval_GetFrame
()¶ - Return value: Borrowed reference.
Return the current thread state’s frame, which is NULL if no frame is currently executing.
-
int
PyFrame_GetLineNumber
(PyFrameObject *frame)¶ 返回 frame 当前正在执行的行号。
-
const char*
PyEval_GetFuncDesc
(PyObject *func)¶ 根据 func 的类型返回描述字符串。 返回值包括函数和方法的 “()”, ” constructor”, ” instance” 和 ” object”。 与
PyEval_GetFuncName()
的结果连接,结果将是 func 的描述。