mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Fix the baffler that Tim reported: sometimes the repr() of an object
looks like <X object at ...>, sometimes it says <X instance at ...>. Make this uniformly say <X object at ...>.
This commit is contained in:
parent
f244b2e47c
commit
ff0e6d6ef5
2 changed files with 4 additions and 4 deletions
|
@ -1157,12 +1157,12 @@ object_repr(PyObject *self)
|
|||
if (name == NULL)
|
||||
return NULL;
|
||||
if (mod != NULL && strcmp(PyString_AS_STRING(mod), "__builtin__"))
|
||||
rtn = PyString_FromFormat("<%s.%s instance at %p>",
|
||||
rtn = PyString_FromFormat("<%s.%s object at %p>",
|
||||
PyString_AS_STRING(mod),
|
||||
PyString_AS_STRING(name),
|
||||
self);
|
||||
else
|
||||
rtn = PyString_FromFormat("<%s instance at %p>",
|
||||
rtn = PyString_FromFormat("<%s object at %p>",
|
||||
type->tp_name, self);
|
||||
Py_XDECREF(mod);
|
||||
Py_DECREF(name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue