リフレクション¶
-
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.
現在の実行フレーム内のローカル変数の辞書か、実行中のフレームがなければ
NULLを返します。
-
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を返します。See also
PyThreadState_GetFrame().
-
PyFrameObject *
PyFrame_GetBack(PyFrameObject *frame)¶ Get the frame next outer frame.
Return a strong reference, or
NULLif 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 beNULL.バージョン 3.9 で追加.
-
int
PyFrame_GetLineNumber(PyFrameObject *frame)¶ - Part of the Stable ABI since version 3.10.
frame が現在実行している行番号を返します。
frame must not be
NULL.
-
const char *
PyEval_GetFuncName(PyObject *func)¶ - Part of the Stable ABI.
func が関数、クラス、インスタンスオブジェクトであればその名前を、そうでなければ func の型を返します。
-
const char *
PyEval_GetFuncDesc(PyObject *func)¶ - Part of the Stable ABI.
func の型に依存する、解説文字列(description string)を返します。戻り値は、関数とメソッドに対しては "()", " constructor", " instance", " object" です。
PyEval_GetFuncName()と連結された結果、 func の解説になります。