[pygobject/gsoc2009: 128/160] Add the Python instance's type and address in pyg_boxed_repr



commit 7504c85bf26be78ab3d8af0224d3e39ed630d0d8
Author: Simon van der Linden <svdlinden src gnome org>
Date:   Tue Aug 11 11:27:31 2009 +0200

    Add the Python instance's type and address in pyg_boxed_repr

 gobject/pygboxed.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/gobject/pygboxed.c b/gobject/pygboxed.c
index eb274a2..1dd2dec 100644
--- a/gobject/pygboxed.c
+++ b/gobject/pygboxed.c
@@ -62,11 +62,8 @@ pyg_boxed_hash(PyGBoxed *self)
 static PyObject *
 pyg_boxed_repr(PyGBoxed *self)
 {
-    gchar buf[128];
-
-    g_snprintf(buf, sizeof(buf), "<%s at 0x%lx>", g_type_name(self->gtype),
-	       (long)self->boxed);
-    return _PyUnicode_FromString(buf);
+    return PyString_FromFormat("<%s object at 0x%p (%s at 0x%p)>",
+            self->ob_type->tp_name, self, g_type_name(self->gtype), self->boxed);
 }
 
 static int



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]