[PyQt] Python v3 Status
Phil Thompson
phil at riverbankcomputing.com
Wed Apr 8 22:20:35 BST 2009
On Sat, 4 Apr 2009 11:17:11 +0200, Detlev Offenbach
<detlev at die-offenbachs.de> wrote:
> Hi,
>
> that is good news. Do you have any experience how the performance of
> programs
> differ between Python v3 and Python v2.
No.
> Are there any hints about how to
> write a program, that runs with both variants of Python (e.g. writing
> compatibility methods that e.g. turn print() calls into print statements
> for
> v2 or that turn unicode() to str() for v3).
With simple programs like the different configure.py and the PyQt examples
its easy to write code that works with Python v2.3 and v3.x.
pyuic required a bit more, but not much. The main problem was the different
exception handling syntax.
It will depend on your coding style. For example, if you keep things in
QStrings for as long as possible then you'll have less of a porting effort
than if you used unicode() to convert to native Python objects all over the
place.
Phil
More information about the PyQt
mailing list