mirror of
https://github.com/python/cpython.git
synced 2025-09-27 18:59:43 +00:00
_PyObject_Dump(): print the type of the object. This is by far the
most frequently interesting information IMO. Also tidy up the output.
This commit is contained in:
parent
4441001b56
commit
5f5512d246
1 changed files with 8 additions and 2 deletions
|
@ -194,9 +194,15 @@ void _PyObject_Dump(PyObject* op)
|
||||||
if (op == NULL)
|
if (op == NULL)
|
||||||
fprintf(stderr, "NULL\n");
|
fprintf(stderr, "NULL\n");
|
||||||
else {
|
else {
|
||||||
|
fprintf(stderr, "object : ");
|
||||||
(void)PyObject_Print(op, stderr, 0);
|
(void)PyObject_Print(op, stderr, 0);
|
||||||
fprintf(stderr, "\nrefcounts: %d\n", op->ob_refcnt);
|
fprintf(stderr, "\n"
|
||||||
fprintf(stderr, "address : %p\n", op);
|
"type : %s\n"
|
||||||
|
"refcount: %d\n"
|
||||||
|
"address : %p\n",
|
||||||
|
op->ob_type==NULL ? "NULL" : op->ob_type->tp_name,
|
||||||
|
op->ob_refcnt,
|
||||||
|
op);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue