summaryrefslogtreecommitdiff
path: root/devdocs/python~3.12/c-api%2Freflection.html
blob: 4145a9d9afd550b25b90991ab94824882da518ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 <span id="id1"></span><h1>Reflection</h1> <dl class="c function"> <dt class="sig sig-object c" id="c.PyEval_GetBuiltins">
<code>PyObject *PyEval_GetBuiltins(void)</code> </dt> <dd>
<em class="refcount">Return value: Borrowed reference.</em><em class="stableabi"> Part of the <a class="reference internal" href="stable#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Return a dictionary of the builtins in the current execution frame, or the interpreter of the thread state if no frame is currently executing.</p> </dd>
</dl> <dl class="c function"> <dt class="sig sig-object c" id="c.PyEval_GetLocals">
<code>PyObject *PyEval_GetLocals(void)</code> </dt> <dd>
<em class="refcount">Return value: Borrowed reference.</em><em class="stableabi"> Part of the <a class="reference internal" href="stable#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Return a dictionary of the local variables in the current execution frame, or <code>NULL</code> if no frame is currently executing.</p> </dd>
</dl> <dl class="c function"> <dt class="sig sig-object c" id="c.PyEval_GetGlobals">
<code>PyObject *PyEval_GetGlobals(void)</code> </dt> <dd>
<em class="refcount">Return value: Borrowed reference.</em><em class="stableabi"> Part of the <a class="reference internal" href="stable#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Return a dictionary of the global variables in the current execution frame, or <code>NULL</code> if no frame is currently executing.</p> </dd>
</dl> <dl class="c function"> <dt class="sig sig-object c" id="c.PyEval_GetFrame">
<code>PyFrameObject *PyEval_GetFrame(void)</code> </dt> <dd>
<em class="refcount">Return value: Borrowed reference.</em><em class="stableabi"> Part of the <a class="reference internal" href="stable#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Return the current thread state’s frame, which is <code>NULL</code> if no frame is currently executing.</p> <p>See also <a class="reference internal" href="init#c.PyThreadState_GetFrame" title="PyThreadState_GetFrame"><code>PyThreadState_GetFrame()</code></a>.</p> </dd>
</dl> <dl class="c function"> <dt class="sig sig-object c" id="c.PyEval_GetFuncName">
<code>const char *PyEval_GetFuncName(PyObject *func)</code> </dt> <dd>
<em class="stableabi"> Part of the <a class="reference internal" href="stable#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Return the name of <em>func</em> if it is a function, class or instance object, else the name of <em>func</em>s type.</p> </dd>
</dl> <dl class="c function"> <dt class="sig sig-object c" id="c.PyEval_GetFuncDesc">
<code>const char *PyEval_GetFuncDesc(PyObject *func)</code> </dt> <dd>
<em class="stableabi"> Part of the <a class="reference internal" href="stable#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Return a description string, depending on the type of <em>func</em>. Return values include “()” for functions and methods, ” constructor”, ” instance”, and ” object”. Concatenated with the result of <a class="reference internal" href="#c.PyEval_GetFuncName" title="PyEval_GetFuncName"><code>PyEval_GetFuncName()</code></a>, the result will be a description of <em>func</em>.</p> </dd>
</dl> <div class="_attribution">
  <p class="_attribution-p">
    &copy; 2001&ndash;2023 Python Software Foundation<br>Licensed under the PSF License.<br>
    <a href="https://docs.python.org/3.12/c-api/reflection.html" class="_attribution-link">https://docs.python.org/3.12/c-api/reflection.html</a>
  </p>
</div>