blob: 234d66bd5682daf762db8533f0b781242982264d [file] [log] [blame]
Georg Brandl54a3faa2008-01-20 09:30:57 +00001.. highlightlang:: c
2
3.. _reflection:
4
5Reflection
6==========
7
8.. cfunction:: PyObject* PyEval_GetBuiltins()
9
10 Return a dictionary of the builtins in the current execution frame,
11 or the interpreter of the thread state if no frame is currently executing.
12
13
14.. cfunction:: PyObject* PyEval_GetLocals()
15
16 Return a dictionary of the local variables in the current execution frame,
17 or *NULL* if no frame is currently executing.
Georg Brandl48310cd2009-01-03 21:18:54 +000018
Georg Brandl54a3faa2008-01-20 09:30:57 +000019
20.. cfunction:: PyObject* PyEval_GetGlobals()
21
22 Return a dictionary of the global variables in the current execution frame,
23 or *NULL* if no frame is currently executing.
24
25
26.. cfunction:: PyFrameObject* PyEval_GetFrame()
27
28 Return the current thread state's frame, which is *NULL* if no frame is
29 currently executing.
30
31
Alexandre Vassalotti7b82b402009-07-21 04:30:03 +000032.. cfunction:: int PyFrame_GetLineNumber(PyFrameObject *frame)
33
34 Return the line number that *frame* is currently executing.
35
36
Georg Brandl54a3faa2008-01-20 09:30:57 +000037.. cfunction:: const char* PyEval_GetFuncName(PyObject *func)
38
39 Return the name of *func* if it is a function, class or instance object, else the
40 name of *func*\s type.
41
42
43.. cfunction:: const char* PyEval_GetFuncDesc(PyObject *func)
44
45 Return a description string, depending on the type of *func*.
46 Return values include "()" for functions and methods, " constructor",
47 " instance", and " object". Concatenated with the result of
48 :cfunc:`PyEval_GetFuncName`, the result will be a description of
49 *func*.