summaryrefslogtreecommitdiffstats
path: root/Doc/api
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-09-04 22:08:56 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-09-04 22:08:56 (GMT)
commit7eea37e8317bda88d9f50b862f13642e837957ce (patch)
tree33b41620f6b0e2266d19d43aa8fad9743f3bb3d4 /Doc/api
parent2f760c35e2372dc50102305f407e5eed7e7b5c0a (diff)
downloadcpython-7eea37e8317bda88d9f50b862f13642e837957ce.zip
cpython-7eea37e8317bda88d9f50b862f13642e837957ce.tar.gz
cpython-7eea37e8317bda88d9f50b862f13642e837957ce.tar.bz2
At Guido's suggestion, here's a new C API function, PyObject_Dir(), like
__builtin__.dir(). Moved the guts from bltinmodule.c to object.c.
Diffstat (limited to 'Doc/api')
-rw-r--r--Doc/api/api.tex10
1 files changed, 10 insertions, 0 deletions
diff --git a/Doc/api/api.tex b/Doc/api/api.tex
index 8836cdf..a185509 100644
--- a/Doc/api/api.tex
+++ b/Doc/api/api.tex
@@ -1720,6 +1720,16 @@ must return an integer or long integer, which is returned as the file
descriptor value. Returns \code{-1} on failure.
\end{cfuncdesc}
+\begin{cfuncdesc}{PyObject*}{PyObject_Dir}{PyObject *o}
+This is equivalent to the Python expression \samp{dir(\var{o})},
+returning a (possibly empty) list of strings appropriate for the
+object argument, or \NULL{} in case of error.
+If the argument is \NULL{}, this is like the Python \samp{dir()},
+returning the names of the current locals; in this case, if no
+execution frame is active then \NULL{} is returned but
+\cfunction{PyErr_Occurred()} will return false.
+\end{cfuncdesc}
+
\section{Number Protocol \label{number}}