Issue #19034: repr() for tkinter.Tcl_Obj now exposes string reperesentation.

This commit is contained in:
Serhiy Storchaka 2013-09-23 22:49:02 +03:00
parent 64a9972b40
commit 463bd4b5c6
2 changed files with 9 additions and 2 deletions

View file

@ -12,6 +12,8 @@ Core and Builtins
Library Library
------- -------
- Issue #19034: repr() for tkinter.Tcl_Obj now exposes string reperesentation.
- Issue #18978: ``urllib.request.Request`` now allows the method to be - Issue #18978: ``urllib.request.Request`` now allows the method to be
indicated on the class and no longer sets it to None in ``__init__``. indicated on the class and no longer sets it to None in ``__init__``.

View file

@ -737,8 +737,13 @@ PyTclObject_str(PyTclObject *self, void *ignored)
static PyObject * static PyObject *
PyTclObject_repr(PyTclObject *self) PyTclObject_repr(PyTclObject *self)
{ {
return PyUnicode_FromFormat("<%s object at %p>", PyObject *repr, *str = PyTclObject_str(self, NULL);
self->value->typePtr->name, self->value); if (str == NULL)
return NULL;
repr = PyUnicode_FromFormat("<%s object: %R>",
self->value->typePtr->name, str);
Py_DECREF(str);
return repr;
} }
#define TEST_COND(cond) ((cond) ? Py_True : Py_False) #define TEST_COND(cond) ((cond) ? Py_True : Py_False)