Mercurial > cpython-lru_cache-weakref
annotate Doc/c-api/reflection.rst @ 79675:c0a2294de787 2.7
Issue #16199: Backport 2to3 typo fix from 3.2.
| author | Chris Jerdonek <chris.jerdonek@gmail.com> |
|---|---|
| date | Thu, 11 Oct 2012 16:15:46 -0700 |
| parents | 74ff71b2f53d |
| children |
| rev | line source |
|---|---|
|
44797
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
1 .. highlightlang:: c |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
2 |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
3 .. _reflection: |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
4 |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
5 Reflection |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
6 ========== |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
7 |
|
74395
74ff71b2f53d
update to new C roles and directives
Sandro Tosi <sandro.tosi@gmail.com>
parents:
55372
diff
changeset
|
8 .. c:function:: PyObject* PyEval_GetBuiltins() |
|
44797
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
9 |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
10 Return a dictionary of the builtins in the current execution frame, |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
11 or the interpreter of the thread state if no frame is currently executing. |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
12 |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
13 |
|
74395
74ff71b2f53d
update to new C roles and directives
Sandro Tosi <sandro.tosi@gmail.com>
parents:
55372
diff
changeset
|
14 .. c:function:: PyObject* PyEval_GetLocals() |
|
44797
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
15 |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
16 Return a dictionary of the local variables in the current execution frame, |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
17 or *NULL* if no frame is currently executing. |
|
50563
93cf3a6ead63
Merged revisions 68226 via svnmerge from
Georg Brandl <georg@python.org>
parents:
44797
diff
changeset
|
18 |
|
44797
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
19 |
|
74395
74ff71b2f53d
update to new C roles and directives
Sandro Tosi <sandro.tosi@gmail.com>
parents:
55372
diff
changeset
|
20 .. c:function:: PyObject* PyEval_GetGlobals() |
|
44797
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
21 |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
22 Return a dictionary of the global variables in the current execution frame, |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
23 or *NULL* if no frame is currently executing. |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
24 |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
25 |
|
74395
74ff71b2f53d
update to new C roles and directives
Sandro Tosi <sandro.tosi@gmail.com>
parents:
55372
diff
changeset
|
26 .. c:function:: PyFrameObject* PyEval_GetFrame() |
|
44797
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
27 |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
28 Return the current thread state's frame, which is *NULL* if no frame is |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
29 currently executing. |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
30 |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
31 |
|
74395
74ff71b2f53d
update to new C roles and directives
Sandro Tosi <sandro.tosi@gmail.com>
parents:
55372
diff
changeset
|
32 .. c:function:: int PyFrame_GetLineNumber(PyFrameObject *frame) |
|
55372
79718ee03986
Merged revisions 72487-72488,72879 via svnmerge from
Alexandre Vassalotti <alexandre@peadrop.com>
parents:
50563
diff
changeset
|
33 |
|
79718ee03986
Merged revisions 72487-72488,72879 via svnmerge from
Alexandre Vassalotti <alexandre@peadrop.com>
parents:
50563
diff
changeset
|
34 Return the line number that *frame* is currently executing. |
|
79718ee03986
Merged revisions 72487-72488,72879 via svnmerge from
Alexandre Vassalotti <alexandre@peadrop.com>
parents:
50563
diff
changeset
|
35 |
|
79718ee03986
Merged revisions 72487-72488,72879 via svnmerge from
Alexandre Vassalotti <alexandre@peadrop.com>
parents:
50563
diff
changeset
|
36 |
|
74395
74ff71b2f53d
update to new C roles and directives
Sandro Tosi <sandro.tosi@gmail.com>
parents:
55372
diff
changeset
|
37 .. c:function:: int PyEval_GetRestricted() |
|
44797
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
38 |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
39 If there is a current frame and it is executing in restricted mode, return true, |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
40 otherwise false. |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
41 |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
42 |
|
74395
74ff71b2f53d
update to new C roles and directives
Sandro Tosi <sandro.tosi@gmail.com>
parents:
55372
diff
changeset
|
43 .. c:function:: const char* PyEval_GetFuncName(PyObject *func) |
|
44797
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
44 |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
45 Return the name of *func* if it is a function, class or instance object, else the |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
46 name of *func*\s type. |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
47 |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
48 |
|
74395
74ff71b2f53d
update to new C roles and directives
Sandro Tosi <sandro.tosi@gmail.com>
parents:
55372
diff
changeset
|
49 .. c:function:: const char* PyEval_GetFuncDesc(PyObject *func) |
|
44797
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
50 |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
51 Return a description string, depending on the type of *func*. |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
52 Return values include "()" for functions and methods, " constructor", |
|
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
53 " instance", and " object". Concatenated with the result of |
|
74395
74ff71b2f53d
update to new C roles and directives
Sandro Tosi <sandro.tosi@gmail.com>
parents:
55372
diff
changeset
|
54 :c:func:`PyEval_GetFuncName`, the result will be a description of |
|
44797
ec02dbe6b051
Missed one big file to split up.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
55 *func*. |
