Simon Edwards <[EMAIL PROTECTED]> wrote: >> 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 example >> 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).
I'm not saying it happens often. I'm saying that we the proposed change it would be *impossible* to do it. On the other hand, with the current interface it is possible to do exactly what you want, it is just a little less convenient for the common case. > 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). This is an orthogonal issue, and I admit that it can get annoying pretty fast. There is a simple solution though: I have been meaning to suggest Phil to add an exception-raising __hash__ method to QString. Those who want to hash by identify can still do it explicitally (calling id()), instead of relying on it being the default. -- Giovanni Bajo _______________________________________________ PyKDE mailing list [email protected] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
