/weblog/a-stepping-stone-to-python-3

Python 2.6, A stepping stone to Python 3

Monday, October 06, 2008

Python, an open source programming language, is about to release an all new version 3.0 of its platform; a release that deviates in many ways from the current 2.x version of Python. Python 3.0 is a major redesign of the language that is about addressing and fixing earlier design decisions that are now considered flaws. As yet, no date has been set for the release of Python 3.0.

Developers like myself will face a transition moving from the current 2.x to the bleeding edge 3.0 version of Python. To address this language barrier, version 2.6 was released this past week by the Python Software Foundation.

The release of 2.6 comes as the market for Python use is expanding; thanks its use in projects like Google's AppEngine. Python's enterprise adoption is on the rise. As more and more developers write Python code, that growing base will be affected by the dramatic changes in the language structure; Python 2.6 aims to soften the impact of these changes.

Python 2.6 allows for the use of some of Python 3.0 features immediately and selectively, without sacrificing compatibility with existing libraries. With a simple import statement, Python 3's new unicode literals, print function become and includes support for the new multiprocessing for computers with multi-core CPUs.

I am eager to add the improved AJAX capabilities from the standard Python library to my web application projects. With Python 2.6, I can start getting ready for 3.0 in a number of ways. Turning on "Py3k warnings" will warn me about depreciated language patterns for which alternatives already exist in 2.6. Having that warning gives me the chance to write code using the modern, alternative syntax.

Backward compatibility has been a hallmark of the Python language but sometimes change is good. I look forward to exploring the nuances of version 3 while I write Asterisk Gateway Interface [AGI] and Apache's Common Gateway Interface [CGI] applications for my cliental. Python 2.6 was designed to pave the way for my migration.