From: Guido van Rossum Date: Fri, 14 Sep 2001 15:50:08 +0000 (+0000) Subject: _PyObject_Dump(): print the type of the object. This is by far the X-Git-Tag: v2.2.1c1~1808 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f5512d246c58aab5a5290a85a8279f4b91021c4;p=thirdparty%2FPython%2Fcpython.git _PyObject_Dump(): print the type of the object. This is by far the most frequently interesting information IMO. Also tidy up the output. --- diff --git a/Objects/object.c b/Objects/object.c index 718dddf7cfe3..30263ba0f1ee 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -194,9 +194,15 @@ void _PyObject_Dump(PyObject* op) if (op == NULL) fprintf(stderr, "NULL\n"); else { + fprintf(stderr, "object : "); (void)PyObject_Print(op, stderr, 0); - fprintf(stderr, "\nrefcounts: %d\n", op->ob_refcnt); - fprintf(stderr, "address : %p\n", op); + fprintf(stderr, "\n" + "type : %s\n" + "refcount: %d\n" + "address : %p\n", + op->ob_type==NULL ? "NULL" : op->ob_type->tp_name, + op->ob_refcnt, + op); } }