diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2008-04-07 05:43:42 +0000 |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2008-04-07 05:43:42 +0000 |
commit | 250ad613f3ae7e237e28d3a7a15a9b6fac16129f (patch) | |
tree | 5484e62a1ee0b0d9b7008cad32ab33392db7e78e /Objects/typeobject.c | |
parent | 5a6f4585fdc52959bcc0dfdb9d25f2d34f983300 (diff) | |
download | cpython-git-250ad613f3ae7e237e28d3a7a15a9b6fac16129f.tar.gz |
Bug #2565: The repr() of type objects now calls them 'class',
not 'type' - whether they are builtin types or not.
Diffstat (limited to 'Objects/typeobject.c')
-rw-r--r-- | Objects/typeobject.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 7a6d258329..e2e365e351 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -600,7 +600,6 @@ static PyObject * type_repr(PyTypeObject *type) { PyObject *mod, *name, *rtn; - char *kind; mod = type_module(type, NULL); if (mod == NULL) @@ -613,15 +612,10 @@ type_repr(PyTypeObject *type) if (name == NULL) return NULL; - if (type->tp_flags & Py_TPFLAGS_HEAPTYPE) - kind = "class"; - else - kind = "type"; - if (mod != NULL && PyUnicode_CompareWithASCIIString(mod, "builtins")) - rtn = PyUnicode_FromFormat("<%s '%U.%U'>", kind, mod, name); + rtn = PyUnicode_FromFormat("<class '%U.%U'>", mod, name); else - rtn = PyUnicode_FromFormat("<%s '%s'>", kind, type->tp_name); + rtn = PyUnicode_FromFormat("<class '%s'>", type->tp_name); Py_XDECREF(mod); Py_DECREF(name); |