summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-09-14 15:50:08 (GMT)
committerGuido van Rossum <guido@python.org>2001-09-14 15:50:08 (GMT)
commit5f5512d246c58aab5a5290a85a8279f4b91021c4 (patch)
tree66adee00eb582ab6db4f122a029ccf2ac11b0853 /Objects
parent4441001b56d6179cc3bfa540493a7eb6e0324172 (diff)
downloadcpython-5f5512d246c58aab5a5290a85a8279f4b91021c4.zip
cpython-5f5512d246c58aab5a5290a85a8279f4b91021c4.tar.gz
cpython-5f5512d246c58aab5a5290a85a8279f4b91021c4.tar.bz2
_PyObject_Dump(): print the type of the object. This is by far the
most frequently interesting information IMO. Also tidy up the output.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/object.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/Objects/object.c b/Objects/object.c
index 718dddf..30263ba 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);
}
}