Рефлексія

PyObject *PyEval_GetBuiltins(void)
Return value: Borrowed reference. Part of the Stable ABI.

Повертає словник вбудованих модулів у поточному кадрі виконання або інтерпретатор стану потоку, якщо наразі жоден кадр не виконується.

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 NULL if no frame is currently executing.

PyObject *PyEval_GetGlobals(void)
Return value: Borrowed reference. Part of the Stable ABI.

Повертає словник глобальних змінних у поточному кадрі виконання або NULL, якщо наразі жоден кадр не виконується.

PyFrameObject *PyEval_GetFrame(void)
Return value: Borrowed reference. Part of the Stable ABI.

Повертає фрейм поточного стану потоку, який є NULL, якщо жоден фрейм наразі не виконується.

Дивіться також PyThreadState_GetFrame().

PyFrameObject *PyFrame_GetBack(PyFrameObject *frame)

Get the frame next outer frame.

Return a strong reference, or NULL if frame has no outer frame.

frame must not be NULL.

Нове в версії 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 be NULL.

Нове в версії 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.

Повертає ім’я func, якщо це функція, клас або об’єкт примірника, інакше ім’я типу funcs.

const char *PyEval_GetFuncDesc(PyObject *func)
Part of the Stable ABI.

Повертає рядок опису залежно від типу func. Повернуті значення включають «()» для функцій і методів, «конструктор», «примірник» і «об’єкт». Поєднаний із результатом PyEval_GetFuncName(), результат буде описом func.