On 2010-04-19, Matti Airas wrote:
> On 16.04.2010 18:25, ext Mark Summerfield wrote:
> > No, it _must_ specify "Python 3". API 2 won't work with Python 2 (at
> > least not nicely) because Python 2's str class is local 8 bit not
> > Unicode.
> >
> > How about:
> >
> > Adopt PyQt's API 2 for Python 3/PySide
> >
> > Ah, but in view of what you write later on, then your title would be
> > fine as is.
>
> I'd just drop the slash and either use "Adopt PyQt's API 2 for Python 3
> PySide" or "Adopt PyQt's API 2 for PySide on Python 3". You're the
> native English speaker and professional writer, you choose. :-)
OK, then: "Adopt PyQt's API 2 for PySide on Python 3"
(D'you want me to reissue just for the title change?)
> (Assuming I'm permanently out-voted, that is.)
>
> >> How about having a qVariant class instead?
> >>
> >> function(qVariant.ushort(value))
> >>
> >> This would avoid using the stringified type names.
> >
> > I'm not at all keen on that.
> >
> > For one thing, the idea is to get away from the QVariant class. For
> > another, using qVariant() should be very rare indeed.
>
> Actually, what would your qVariant() function return? A QVariant object?
> In that case, it wouldn't make much sense to just instantiate QVariant
> directly. The same obviously applies to my qVariant idea.
>
> If QVariants are to be avoided, then Richard's tuple syntax might work.
> But I wonder would it be just clearer to use QVariant explicitly when
> absolutely required?
Using the tuple syntax means that you can't pass tuples where a QVariant
is required. You could just have some QVariant static functions,
QVariant.ushort(), etc.
Personally, I think that the key thing that matters here is that Python
programmers should not have to know or care about QVariant, so they
should be completely insulated from it by having automatic conversions.
(But with some kind of back door for when it really matters what kind of
object you want inside the QVariant.)
[snip]
--
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
C++, Python, Qt, PyQt - training and consultancy
"Advanced Qt Programming" - ISBN 0321635906
_______________________________________________
PySide mailing list
[email protected]
http://lists.openbossa.org/listinfo/pyside