示例#1
0
static PyObject *
_base_info_repr (PyGIBaseInfo *self)
{
    return PYGLIB_PyUnicode_FromFormat ("<%s object (%s) at 0x%p>",
                                        Py_TYPE( (PyObject *) self)->tp_name, 
                                        g_base_info_get_name (self->info), 
                                        (void *) self);
}
示例#2
0
static PyObject *
struct_repr(PyGIStruct *self)
{
    PyObject* repr;
    GIBaseInfo *info;
    PyGPointer *pointer = (PyGPointer *)self;

    info = struct_get_info (Py_TYPE (self));
    if (info == NULL)
        return NULL;

    repr = PYGLIB_PyUnicode_FromFormat ("<%s.%s object at %p (%s at %p)>",
                                        g_base_info_get_namespace (info),
                                        g_base_info_get_name (info),
                                        self, g_type_name (pointer->gtype),
                                        pointer->pointer);

    g_base_info_unref (info);

    return repr;
}