summaryrefslogtreecommitdiffstats
path: root/Include/object.h
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 /Include/object.h
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 'Include/object.h')
-rw-r--r--Include/object.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/Include/object.h b/Include/object.h
index 6cd20a6..d9c3514 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -346,6 +346,14 @@ extern DL_IMPORT(int) PyNumber_CoerceEx(PyObject **, PyObject **);
extern DL_IMPORT(void) (*PyObject_ClearWeakRefs)(PyObject *);
+/* PyObject_Dir(obj) acts like Python __builtin__.dir(obj), returning a
+ list of strings. PyObject_Dir(NULL) is like __builtin__.dir(),
+ returning the names of the current locals. In this case, if there are
+ no current locals, NULL is returned, and PyErr_Occurred() is false.
+*/
+extern DL_IMPORT(PyObject *) PyObject_Dir(PyObject *);
+
+
/* Helpers for printing recursive container types */
extern DL_IMPORT(int) Py_ReprEnter(PyObject *);
extern DL_IMPORT(void) Py_ReprLeave(PyObject *);