[PyKDE] QString in PyQt4 - Request for Comments
patrickkidd at gci.net
Tue Oct 18 21:01:41 BST 2005
Yes. Ideally a string would always just be a string; a string should
not be a string and this other thing, too.
A list should be a list, not a list and a list that can only hold
this other thing, too.
On Oct 18, 2005, at 11:53 AM, Simon Edwards wrote:
> On Tuesday 18 October 2005 20:01, Yann Cointepas wrote:
>> Le Mardi 18 Octobre 2005 19:24, Phil Thompson a écrit :
>>> I'm wondering whether QString should be dropped in PyQt4 in order
>>> to make
>>> it more Pythonic.
>> Would it mean that QString content would always be copied when
>> used in
>> Python ? If yes, copying a QString from a widget to another (for
>> widget1.setCaption( widget2.caption() ) ) would lead to an
>> unnecessary copy.
> True, but how often do you copy a string from one widget to
> another? I'm
> guessing almost never (never= not often enough to worry about, or be
> performance critical).
> The only place that copying might be an issue is in something like
> Qt's XML
> parser. Otherwise I say drop QString. The whole "add str()" thing
> is a pain
> in the ass and leads to subtle bugs (espically when you use strings
> as keys
> in dictionaries).
> Simon Edwards | Guarddog Firewall
> simon at simonzone.com | http://www.simonzone.com/software/
> Nijmegen, The Netherlands | "ZooTV? You made the right choice."
> PyKDE mailing list PyKDE at mats.imk.fraunhofer.de
More information about the PyQt