Mercurial > cpython-lru_cache-weakref
diff Doc/api/api.tex @ 19705:b7f6fbc087a7 legacy-trunk
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.
| author | Tim Peters <tim.peters@gmail.com> |
|---|---|
| date | Tue, 04 Sep 2001 22:08:56 +0000 |
| parents | 43fe9377e2cf |
| children | f56c91820fae |
line wrap: on
line diff
--- a/Doc/api/api.tex Tue Sep 04 21:33:12 2001 +0000 +++ b/Doc/api/api.tex Tue Sep 04 22:08:56 2001 +0000 @@ -1720,6 +1720,16 @@ 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}}
