Python 3 and Backwards Compatibility?

A while ago, we had a big discussion in the software.coop about what programming language we should prefer when we have a completely free choice. Ultimately, while all the workers have our own favourites (like my Lisp and Perl bias), we decided we all like Python, with quite an affection for django.

One of the reasons for this was the backwards compatibility: Python has generally not broken everything when a new version appeared, as far as we’ve noticed. Compare that to the version hell which is still going on with PHP 4 and 5 on many of the major web hosting services – with PHP 3 to 4 being little better and PHP 6 already on the horizon threatening more of the same, as far as I know.

Now, Python 3 is around and takes a leaf out of PHP’s upgrade HowNotTo, being “designed from the get-go to be incompatible with prior versions”. Should I expect Python to handle this upgrade better than PHP and, if so, why? I guess the mod_wsgi ability to run multiple Pythons is one help. What other helpful tricks are ready-to-run?

What’s mostly happening in the Python world is that people who are deploying apps are mostly ignoring Python 3. Python 2.6 is still supported, and 2.7 is coming soon. The overall plan, as I understand it, is to have both Pytohn 2.x and 3.x out there for several years, with people slowly moving to 3.x without feeling pressured.

I’m unfamiliar with how php handled its upgrade process, though I know from friends that it was a painful one. The python2to3 upgrade has had a lot of thought and planning though, so hopefully it should be a much smoother transition. Below are a few links on the subject you might find useful.

My guess is that we will see a python2.7 eventually which will have some refinements to python2.6′s Py3k warnings mode as well as improvements to the 2to3 conversion tool. So the transition will get easier with time, and you will have the time with python2′s continued support.