[PyKDE] QString in PyQt4 - Request for Comments

Giovanni Bajo rasky at develer.com
Tue Oct 18 19:44:09 BST 2005


Phil Thompson <phil at riverbankcomputing.co.uk> wrote:

> At the moment Python strings and unicode strings are automatically
converted
> to QStrings when passed as arguments - so there would be no change there.
If
> a QString was returned by a method or an operator then a unicode string
> would be returned instead.

There's a problem with efficiency. Unless you are doing something magic, you
are going to copy the contents of the QStrings into the python object. This
might matter in some cases. I'm not sure we should drop this just to avoid
calling unicode() explicitally in some cases. It doesn't happen that often
anyway. Weird idea: maybe it would be possible to make it a configure-time
option? Would that be too much of a burden to maintain? In that case, I'm +1
on making the automatic conversion the default.
-- 
Giovanni Bajo




More information about the PyQt mailing list