Mercurial > cpython-lru_cache-weakref
annotate Doc/c-api/reflection.rst @ 54294:dba767bc3155 legacy-trunk
remove mention of old ctypes version
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Sat, 23 May 2009 20:59:09 +0000 |
| parents | 79718ee03986 |
| children | 0eec633ef0e3 74ff71b2f53d |
| rev | line source |
|---|---|
|
44812
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
1 .. highlightlang:: c |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
2 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
3 .. _reflection: |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
4 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
5 Reflection |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
6 ========== |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
7 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
8 .. cfunction:: PyObject* PyEval_GetBuiltins() |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
9 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
10 Return a dictionary of the builtins in the current execution frame, |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
11 or the interpreter of the thread state if no frame is currently executing. |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
12 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
13 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
14 .. cfunction:: PyObject* PyEval_GetLocals() |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
15 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
16 Return a dictionary of the local variables in the current execution frame, |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
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:
44812
diff
changeset
|
18 |
|
44812
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
19 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
20 .. cfunction:: PyObject* PyEval_GetGlobals() |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
21 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
22 Return a dictionary of the global variables in the current execution frame, |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
23 or *NULL* if no frame is currently executing. |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
24 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
25 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
26 .. cfunction:: PyFrameObject* PyEval_GetFrame() |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
27 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
28 Return the current thread state's frame, which is *NULL* if no frame is |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
29 currently executing. |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
30 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
31 |
|
55372
79718ee03986
Merged revisions 72487-72488,72879 via svnmerge from
Alexandre Vassalotti <alexandre@peadrop.com>
parents:
50563
diff
changeset
|
32 .. cfunction:: int PyFrame_GetLineNumber(PyFrameObject *frame) |
|
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 |
|
44812
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
37 .. cfunction:: int PyEval_GetRestricted() |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
38 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
39 If there is a current frame and it is executing in restricted mode, return true, |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
40 otherwise false. |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
41 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
42 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
43 .. cfunction:: const char* PyEval_GetFuncName(PyObject *func) |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
44 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
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 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
46 name of *func*\s type. |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
47 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
48 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
49 .. cfunction:: const char* PyEval_GetFuncDesc(PyObject *func) |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
50 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
51 Return a description string, depending on the type of *func*. |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
52 Return values include "()" for functions and methods, " constructor", |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
53 " instance", and " object". Concatenated with the result of |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
54 :cfunc:`PyEval_GetFuncName`, the result will be a description of |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
55 *func*. |
