mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
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.
This commit is contained in:
parent
2f760c35e2
commit
7eea37e831
5 changed files with 167 additions and 138 deletions
|
@ -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 *);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue