Hello,

with SIP 4.4 coming out and the advanced duck typing between QString and Python
strings, I wonder if it's time for QString (and maybe other Qt data types) to
get more meaningful repr strings. For instance:

>>> from qt import *
>>> a = QString("foo")
>>> file(a)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
IOError: [Errno 2] No such file or directory: <qt.QString object at 0x029693D8>

Pretty useless error, isn't it? I'd suggest a repr string along the lines of:

>>> a
QString(u"foo")

So that eval(repr(a)) works.

I can think of several classes which could really benefit from more informative
repr strings: QPoint, QRect, QSize...

Giovanni Bajo

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

Reply via email to