

Writing Python 2.x forward compatible to Python 3 code - bretpiatt
http://lucumr.pocoo.org/2011/1/22/forwards-compatible-python/

======
davidhollander
For web development in Py3k the big holdback has been PEP3333, but it recently
stabilized this month which is great news!
<http://www.python.org/dev/peps/pep-3333/>

Also be aware of the following:

There is currently no memcached library for Py3k.
<https://github.com/lericson/pylibmc/issues#issue/21>

[edit: If you use the uWSGI appserver with nginx or cherokee to deploy, I
believe it will have cacheing for Py3k in its .97 release next month]

One of the problems is python.org has been emphasizing a Python2to3 without a
Python3to2 converter. The ideal situation would be library, framework and
module developers write in Python 3 and release a compatibility Python2
version via an automated converter, rather than the other way around.
Otherwise they will be forced to do primary development in Python2 and not
have the resources to maintain a separate Py3 branch.

Link to Python3to2 repository: <https://bitbucket.org/amentajo/lib3to2/>

------
djacobs
As someone who's learning both right now and not sure which to use, this is
invaluable.

~~~
prog
I would love to use 3.x but went with 2.7.x as I need Django, and cx_Oracle.
Django is 2.x only, I haven't really checked cx_Oracle.

~~~
dgallagher
...which raises the question: Does anyone know when Django plans to migrate to
Python 3.x? Django 2.0 perhaps, whenever that may be?

~~~
koenigdavidmj
They currently are compatible back to 2.4. They want to drop one Python
release per Django release (1.3 will support 2.5 and up, 1.4 will support 2.6
and up). 2.6 is the cutoff when syntax will work everywhere.

~~~
dlib
How are they dealing with Google AppEngine's support for 2.5 when Django
reaches 1.4? Or is AppEngine also expected to upgrade to 2.6 (or higher)
anytime soon?

~~~
koenigdavidmj
They still maintain the old versions too. Last security update featured new
point releases of 1.1, 1.2, and 1.3 beta. So you can just use the old version
until Google get their act together.

------
viraptor
> For new projects, start with Python 2.6 or 2.7

Unless you want your project used on debian stable, that is... In which case
your exception handlers will be simply not compatible between versions.

~~~
mariana
The next release of Debian stable will have Python 2.6 as default and it is
expected for the first weekend of February, so it is safe to start with Python
2.6 right now.

~~~
viraptor
True. However keep in mind who uses debian stable... people who won't jump on
squeeze the moment it gets stable. It will still take months before the
situation really changes. But yeah - I agree that 2.6 is pretty much safe for
new stuff.

~~~
ubernostrum
People who use Debian stable also aren't going to use your new library anyway.
They're not running stable because they want to install a bunch of recent
stuff, after all...

~~~
viraptor
Why wouldn't they? I had to choose which version to target when writing some
software lately. The production was debian stable yet I wanted to release the
project for others. In the end I have to keep 2 branches - one for 2.X and
another for 3.X - it was a trivial piece of code, so it's not a big problem,
but I can imagine how silly it must be for bigger projects.

------
ylem
Have any of you looked at the changes in how super works from python 2.5 to
2.6 and how it changes for 3.0? This has bitten me for a library I was using
with Django...

~~~
mgedmin
details?

