[PyKDE] Printing empty QStrings

Coy Krill ckrill at qvlinc.com
Fri Nov 3 17:45:52 GMT 2000


According to the "Python Essential Reference" repr should return a string 
that when evaluated would recreate the object. For a null QString repr should 
return something like "QString()" .

Coy

On Friday 03 November 2000 01:33, you wrote:
> Andrew Kuchling wrote:
> > On Thu, Nov 02, 2000 at 05:50:15PM +0000, Phil Thompson wrote:
> > >I'm more and more inclined to go with repr of a null QString and an
> >
> >                                        ^^^^
> >
> > >empty QString to both return an empty Python string. Generally QString
> >
> > This is a typo for str, right?  repr() is commonly used for debugging
> > printouts, so you usually want as much info as possible.
>
> No it's not a typo. At the moment str isn't implemented and falls back
> to repr. One of the suggestions I made was to implement str and have
> both null and empty QStrings return an empty Python string, and to have
> repr return (for a null QString) soemthing like "<null QString at
> zzzz>".
>
> Would this be the best compromise, consistent with the rest of Python?
>
> Phil
>
> _______________________________________________
> PyKDE mailing list    PyKDE at mats.gmd.de
> http://mats.gmd.de/mailman/listinfo/pykde




More information about the PyQt mailing list