Since PyCon I have been working on a set of tests to demonstrate incompatibilities between Python 2.5, 2.6 and 3.0, with the aim of not only documenting the incompatibilities, but also testing if you avoid them, and write code that runs under both Python 2.6 and 3.0, thereby providing a transitional path from 2.x to 3.0. (2.5 code should run under 2.6 unmodified, so that part of the transition is done).

I found only one major incompatibility, that 2.6 required u” for Unicode, but 3.0 doesn’t support it. This was solved in Python 2.6a3, which introduced a from __future__ import unicode_literals, which makes 2.6 behave the same as 3.0. Thanks for that!

So, at the moment, I’m not aware of any major unavoidable incompatibilities. I decided to put up my half-assed code somewhere public, so other people can add to it. So, I created a new project on code.google.com: http://code.google.com/p/python-incompatibility/

You can check out out for yourselves. running runtests.py 26 will work on both Python 2.6 and Python 3.0.

But the code isn’t finished yet. There may be incompatibilities I haven’t thought about, and there are no tests of the library reorganisation. Please help out on this! It’s fun, easy and a great way to learn Python 3.0!

See also: https://regebro.wordpress.com/2007/06/23/python-3000-and-compatibility/, https://regebro.wordpress.com/2008/03/22/why-python-26-and-30-compatibility-would-be-a-very-good-thing/