[PyQt] PyQt4 and Python 3.0
Mark Summerfield
mark at qtrac.eu
Fri Oct 3 17:08:49 BST 2008
On 2008-10-03, Phil Thompson wrote:
> On Fri, 3 Oct 2008 17:11:19 +0200, Detlev Offenbach
>
> <detlev at die-offenbachs.de> wrote:
> > Hi,
> >
> > will there be PyQt4 support for Python 3.0 once it goes final?
>
> Not straight away. I will take the opportunity to break backwards
> compatibility (eg. removing QVariant, QString, QChar, QByteArray etc),
> and those changes will be made over a period of time. So it may be a
> while before the API is stable enough for anything other than playing.
I've been waiting for someone to mention this...
Here's my personal "wish list" for Python 3/PyQt4 (including those that
Phil is going to do as he says above):
- No QString, only str, plus some static functions for things that str
doesn't provide, e.g., QString.simplified(s : str) -> str
- No QByteArray, only bytes (or bytearray)
- No QVariant, only object
- Guarantee that "from PyQt4.QtGui import *" and similar will only
import objects whose name begins with capital Q.
- Make PyQt more Pythonic. So use exceptions not error codes, for
example, make QFile.open() raise an exception on error. Also, provide
QDataStream.readColor(), QDataStream.readHostAddress(), etc., i.e., a
reader and a writer _method_ for every QDataStream type for those
allergic to << and >>.
- Support Qt collection types that don't have Python equivalents, e.g.,
QMap (with bytes keys and values) and QVector (with bytes items), plus
wrappers so that strs can be used (just like the bsdb module offers).
- Support super() so that it can be used in PyQt subclasses just like
any other subclasses.
;-)
--
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
C++, Python, Qt, PyQt - training and consultancy
"C++ GUI Programming with Qt 4" - ISBN 0132354160
More information about the PyQt
mailing list