리플렉션

PyObject *PyEval_GetBuiltins(void)
반환값: 빌린 참조. Part of the 안정 ABI.

버전 3.13부터 폐지됨: 대신 PyEval_GetFrameBuiltins()를 사용하십시오.

현재 실행 프레임이나 현재 실행 중인 프레임이 없으면 스레드 상태의 인터프리터의 builtins의 딕셔너리를 반환합니다.

PyObject *PyEval_GetLocals(void)
반환값: 빌린 참조. Part of the 안정 ABI.

버전 3.13부터 폐지됨: Use either PyEval_GetFrameLocals() to obtain the same behaviour as calling locals() in Python code, or else call PyFrame_GetLocals() on the result of PyEval_GetFrame() to access the f_locals attribute of the currently executing frame.

현재 실행 프레임의 지역 변수로의 접근을 제공하는 매핑을 반환하거나, 현재 실행 중인 프레임이 없으면 NULL을 반환합니다.

Refer to locals() for details of the mapping returned at different scopes.

As this function returns a borrowed reference, the dictionary returned for optimized scopes is cached on the frame object and will remain alive as long as the frame object does. Unlike PyEval_GetFrameLocals() and locals(), subsequent calls to this function in the same frame will update the contents of the cached dictionary to reflect changes in the state of the local variables rather than returning a new snapshot.

버전 3.13에서 변경: As part of PEP 667, PyFrame_GetLocals(), locals(), and FrameType.f_locals no longer make use of the shared cache dictionary. Refer to the What’s New entry for additional details.

PyObject *PyEval_GetGlobals(void)
반환값: 빌린 참조. Part of the 안정 ABI.

버전 3.13부터 폐지됨: 대신 PyEval_GetFrameGlobals()를 사용하십시오.

현재 실행 프레임의 전역 변수 딕셔너리를 반환하거나, 현재 실행 중인 프레임이 없으면 NULL을 반환합니다.

PyFrameObject *PyEval_GetFrame(void)
반환값: 빌린 참조. Part of the 안정 ABI.

현재의 스레드 상태의 프레임을 반환합니다. 현재 실행 중의 프레임이 없으면 NULL입니다.

PyThreadState_GetFrame()도 참조하십시오.

PyObject *PyEval_GetFrameBuiltins(void)
반환값: 새 참조. Part of the 안정 ABI 버전 3.13 이후로.

현재 실행 프레임이나 현재 실행 중인 프레임이 없으면 스레드 상태의 인터프리터의 builtins의 딕셔너리를 반환합니다.

Added in version 3.13.

PyObject *PyEval_GetFrameLocals(void)
반환값: 새 참조. Part of the 안정 ABI 버전 3.13 이후로.

현재 실행 프레임의 지역 변수 딕셔너리를 반환하거나, 현재 실행 중인 프레임이 없으면 NULL을 반환합니다. 파이썬 코드에서 locals()를 호출하는 것과 동등합니다.

To access f_locals on the current frame without making an independent snapshot in optimized scopes, call PyFrame_GetLocals() on the result of PyEval_GetFrame().

Added in version 3.13.

PyObject *PyEval_GetFrameGlobals(void)
반환값: 새 참조. Part of the 안정 ABI 버전 3.13 이후로.

현재 실행 프레임의 전역 변수 딕셔너리를 반환하거나, 현재 실행 중인 프레임이 없으면 NULL을 반환합니다. 파이썬 코드에서 globals()를 호출하는 것과 동등합니다.

Added in version 3.13.

const char *PyEval_GetFuncName(PyObject *func)
Part of the 안정 ABI.

func가 함수, 클래스 또는 인스턴스 객체면 func의 이름을 반환하고, 그렇지 않으면 func의 형의 이름을 반환합니다.

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

func의 형에 따라 설명 문자열을 반환합니다. 반환 값에는 함수 및 메서드의 “()”, “ constructor”, “ instance” 및 “ object” 가 포함됩니다. PyEval_GetFuncName()의 결과와 이어붙이면 func의 설명이 됩니다.