Python 2 to Python 3 / Python 3000 / Py3k
Archive - Originally posted on "The Horse's Mouth" - 2008-09-07 06:58:03 - Graham EllisThere's a new release of Python on the horizon. Well - it's rather closer than the horizon, as there are beta test releases around, and a final production release is due within the month. It has been known as Python 3000 and Py3k along the way - but the release is numbered 3.0 and it's really known as "Python 3.0"
Will everyone switch straight away to Python 3? No - I'm sure they won't; it is planned that there will be parallel releases for a while (as there were with PHP as it went from release 4 to release 5) as there are changes which will break source code compatibility. This compatibility issue is always a tough one for the language designers - whether to restrict and encumber development through the life of the language due to early decisions which may have been good at the time but are now outdated, or to bite the bullet and make the changes. And the Python 3 team have taken the latter approach.
I'm running a public Python course over the next few days, and I and my delegates will be using the latest production versions - Python 2.5.x as I write - throughout. However, I'll be training with one eye on Python 3 to ensure I can advise against "dead end programming" and I'll give a keynote / philosophy talk to ensure that all my delegates know where the language is going and can make the very best of the current syntax, and the changes too. And that will be backed up by a demonstration of some of the code we have seen and written during the course on a machine that also has 3.0 installed.
The main philosophies of Python 3 remain the same main philosophies of Python, and that includes providing facilities once (not in a plethora of ways) and preferably in an obvious / well established / old way - so in practise it's not going to be a huge leap to move to Python 3. However, there are tools being provided to help you if you'll be moving code - such as 2to3 which does an automated translation ("good but not perfect") and some new facilities being backported into Python 2.6 which will provide a useful stepping stone.