mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Issue #19034: repr() for tkinter.Tcl_Obj now exposes string reperesentation.
This commit is contained in:
parent
64a9972b40
commit
463bd4b5c6
2 changed files with 9 additions and 2 deletions
|
|
@ -737,8 +737,13 @@ PyTclObject_str(PyTclObject *self, void *ignored)
|
|||
static PyObject *
|
||||
PyTclObject_repr(PyTclObject *self)
|
||||
{
|
||||
return PyUnicode_FromFormat("<%s object at %p>",
|
||||
self->value->typePtr->name, self->value);
|
||||
PyObject *repr, *str = PyTclObject_str(self, NULL);
|
||||
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue