[PyKDE] Printing empty QStrings

Andrew Kuchling akuchlin at mems-exchange.org
Fri Nov 3 18:44:37 GMT 2000


On Fri, Nov 03, 2000 at 05:19:34PM +0000, Phil Thompson wrote:
>I've never taken this too seriously as nothing else seems to follow it
>to the letter - normal class instances for example. Does it mean exactly
>the same object - what about the ctor arguments?

Neither do I; it's too hard to make something eval() able.  Instead, I
think of it this way: repr() is used by programmers debugging
software, to see what objects are; str() is called automatically by
'%s' % obj, PyArg_ParseTuple("s", ...) calls.  To make repr() return
"", for QString == NULL or ever, is completely unacceptable since it
means repr() is lying; to make str() return "" for QString=NULL is
reasonable, if that's the most useful behaviour.

--amk





More information about the PyQt mailing list