source: python/trunk/Doc/c-api/reflection.rst

Last change on this file was 391, checked in by dmik, 11 years ago

python: Merge vendor 2.7.6 to trunk.

  • Property svn:eol-style set to native
File size: 1.5 KB
RevLine 
[2]1.. highlightlang:: c
2
3.. _reflection:
4
5Reflection
6==========
7
[391]8.. c:function:: PyObject* PyEval_GetBuiltins()
[2]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
[391]14.. c:function:: PyObject* PyEval_GetLocals()
[2]15
16 Return a dictionary of the local variables in the current execution frame,
17 or *NULL* if no frame is currently executing.
18
19
[391]20.. c:function:: PyObject* PyEval_GetGlobals()
[2]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
[391]26.. c:function:: PyFrameObject* PyEval_GetFrame()
[2]27
28 Return the current thread state's frame, which is *NULL* if no frame is
29 currently executing.
30
31
[391]32.. c:function:: int PyFrame_GetLineNumber(PyFrameObject *frame)
[2]33
[391]34 Return the line number that *frame* is currently executing.
35
36
37.. c:function:: int PyEval_GetRestricted()
38
[2]39 If there is a current frame and it is executing in restricted mode, return true,
40 otherwise false.
41
42
[391]43.. c:function:: const char* PyEval_GetFuncName(PyObject *func)
[2]44
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
[391]49.. c:function:: const char* PyEval_GetFuncDesc(PyObject *func)
[2]50
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
[391]54 :c:func:`PyEval_GetFuncName`, the result will be a description of
[2]55 *func*.
Note: See TracBrowser for help on using the repository browser.