리플렉션¶
-
PyObject *PyEval_GetBuiltins(void)¶
- Return value: Borrowed reference. Part of the Stable ABI.
버전 3.13부터 폐지됨: 대신
PyEval_GetFrameBuiltins()
를 사용하십시오.현재 실행 프레임이나 현재 실행 중인 프레임이 없으면 스레드 상태의 인터프리터의 builtins의 딕셔너리를 반환합니다.
-
PyObject *PyEval_GetLocals(void)¶
- Return value: Borrowed reference. Part of the Stable ABI.
버전 3.13부터 폐지됨: Use either
PyEval_GetFrameLocals()
to obtain the same behaviour as callinglocals()
in Python code, or else callPyFrame_GetLocals()
on the result ofPyEval_GetFrame()
to access thef_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()
andlocals()
, 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()
, andFrameType.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)¶
- Return value: Borrowed reference. Part of the Stable ABI.
버전 3.13부터 폐지됨: 대신
PyEval_GetFrameGlobals()
를 사용하십시오.현재 실행 프레임의 전역 변수 딕셔너리를 반환하거나, 현재 실행 중인 프레임이 없으면
NULL
을 반환합니다.
-
PyFrameObject *PyEval_GetFrame(void)¶
- Return value: Borrowed reference. Part of the Stable ABI.
Return the attached thread state’s frame, which is
NULL
if no frame is currently executing.PyThreadState_GetFrame()
도 참조하십시오.
-
PyObject *PyEval_GetFrameBuiltins(void)¶
- Return value: New reference. Part of the Stable ABI since version 3.13.
현재 실행 프레임이나 현재 실행 중인 프레임이 없으면 스레드 상태의 인터프리터의 builtins의 딕셔너리를 반환합니다.
Added in version 3.13.
-
PyObject *PyEval_GetFrameLocals(void)¶
- Return value: New reference. Part of the Stable ABI since version 3.13.
현재 실행 프레임의 지역 변수 딕셔너리를 반환하거나, 현재 실행 중인 프레임이 없으면
NULL
을 반환합니다. 파이썬 코드에서locals()
를 호출하는 것과 동등합니다.To access
f_locals
on the current frame without making an independent snapshot in optimized scopes, callPyFrame_GetLocals()
on the result ofPyEval_GetFrame()
.Added in version 3.13.
-
PyObject *PyEval_GetFrameGlobals(void)¶
- Return value: New reference. Part of the Stable ABI since version 3.13.
현재 실행 프레임의 전역 변수 딕셔너리를 반환하거나, 현재 실행 중인 프레임이 없으면
NULL
을 반환합니다. 파이썬 코드에서globals()
를 호출하는 것과 동등합니다.Added in version 3.13.
-
const char *PyEval_GetFuncName(PyObject *func)¶
- Part of the Stable ABI.
func가 함수, 클래스 또는 인스턴스 객체면 func의 이름을 반환하고, 그렇지 않으면 func의 형의 이름을 반환합니다.
-
const char *PyEval_GetFuncDesc(PyObject *func)¶
- Part of the Stable ABI.
func의 형에 따라 설명 문자열을 반환합니다. 반환 값에는 함수 및 메서드의 “()”, “ constructor”, “ instance” 및 “ object” 가 포함됩니다.
PyEval_GetFuncName()
의 결과와 이어붙이면 func의 설명이 됩니다.