blob: 59edbb33e312e6112312f7e61f35242d8234bdf1 [file] [log] [blame]
Georg Brandl79e3d552008-01-19 22:14:27 +00001.. highlightlang:: c
2
3.. _reflection:
4
5Reflection
6==========
7
Sandro Tosi98ed08f2012-01-14 16:42:02 +01008.. c:function:: PyObject* PyEval_GetBuiltins()
Georg Brandl79e3d552008-01-19 22:14:27 +00009
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
Sandro Tosi98ed08f2012-01-14 16:42:02 +010014.. c:function:: PyObject* PyEval_GetLocals()
Georg Brandl79e3d552008-01-19 22:14:27 +000015
16 Return a dictionary of the local variables in the current execution frame,
17 or *NULL* if no frame is currently executing.
Georg Brandlc62ef8b2009-01-03 20:55:06 +000018
Georg Brandl79e3d552008-01-19 22:14:27 +000019
Sandro Tosi98ed08f2012-01-14 16:42:02 +010020.. c:function:: PyObject* PyEval_GetGlobals()
Georg Brandl79e3d552008-01-19 22:14:27 +000021
22 Return a dictionary of the global variables in the current execution frame,
23 or *NULL* if no frame is currently executing.
24
25
Sandro Tosi98ed08f2012-01-14 16:42:02 +010026.. c:function:: PyFrameObject* PyEval_GetFrame()
Georg Brandl79e3d552008-01-19 22:14:27 +000027
28 Return the current thread state's frame, which is *NULL* if no frame is
29 currently executing.
30
31
Sandro Tosi98ed08f2012-01-14 16:42:02 +010032.. c:function:: int PyFrame_GetLineNumber(PyFrameObject *frame)
Jeffrey Yasskinf7f858d2009-05-08 22:23:21 +000033
34 Return the line number that *frame* is currently executing.
35
36
Sandro Tosi98ed08f2012-01-14 16:42:02 +010037.. c:function:: int PyEval_GetRestricted()
Georg Brandl79e3d552008-01-19 22:14:27 +000038
39 If there is a current frame and it is executing in restricted mode, return true,
40 otherwise false.
41
42
Sandro Tosi98ed08f2012-01-14 16:42:02 +010043.. c:function:: const char* PyEval_GetFuncName(PyObject *func)
Georg Brandl79e3d552008-01-19 22:14:27 +000044
45 Return the name of *func* if it is a function, class or instance object, else the
46 name of *func*\s type.
47
48
Sandro Tosi98ed08f2012-01-14 16:42:02 +010049.. c:function:: const char* PyEval_GetFuncDesc(PyObject *func)
Georg Brandl79e3d552008-01-19 22:14:27 +000050
51 Return a description string, depending on the type of *func*.
52 Return values include "()" for functions and methods, " constructor",
53 " instance", and " object". Concatenated with the result of
Sandro Tosi98ed08f2012-01-14 16:42:02 +010054 :c:func:`PyEval_GetFuncName`, the result will be a description of
Georg Brandl79e3d552008-01-19 22:14:27 +000055 *func*.