[PyQt] Repr for "value" objects

Giovanni Bajo rasky at develer.com
Mon Dec 17 13:40:18 GMT 2007


Hi,

there are many classes in PyQt which would benefit from a custom 
__repr__ method to show their contents. For instance, I'm getting tired 
of having to write:

    def mousePressEvent(self, e):
        print e.pos().x(), e.pos().y()

instead of:

    def mousePressEvent(self, e):
        print e.pos()

just because I otherwise get "<PyQt4.QtCore.QPoint object at 0x298EA468>".

Are there any plans to add this to PyQt? I'm happy to provide a list of 
objects that might have a custom repr method, and even to actually write 
the code (if Phil explains me how he prefers this to be submitted -- 
given metasip).

Thanks!
-- 
Giovanni Bajo



More information about the PyQt mailing list