[PyQt] Re: join() can't handle a QString

Alberto Berti alberto at metapensiero.it
Tue Jun 24 00:24:33 BST 2008

>>>>> "Chris" == Christoph Burgmer <chrislb at gmx.de> writes:

    Chris> QString is pretty much well integrated as much as I
    Chris> understand. I can write "print QString('foo')" or
    Chris> "len(QString('bar'))". It will always be cast to the str
    Chris> type (btw, why not to unicode?).

    Chris> Seeing today that the following wouldn't work makes me ask
    Chris> if that was forgotten or if there is a story behing it:

The story probably is that the binding implements __str__ and __len__
to be compatible with print and len(), but the join() string functions
expect a string or an instance of a class which is subclass of string
which QString isn't

More information about the PyQt mailing list