Tuesday, May 4, 2010

Python 3 Adoption

Python 3 is the first backward-incompatible version of the Python programming language. This incompatibility was intentional and necessary in order to fix a number of issues with Python 2. However, there are a number of Python developers who aren't happy with the changes introduced in Python 3. These complaints are reflected in the seemingly poor adoption of the next-generation Python. This didn't exactly come as a surprise to the creators of Python 3. This is why support for Python 2 will continue for years to come.

I'll admit, I wasn't exactly elated that Python 3 wouldn't be compatible with Python 2 applications. Who would be? You've spent months or years working out intricacies to yield a stable Python 2 application. This incompatibility would dictate that you throw it all away. Well, maybe not exactly, there are upgrading utilities to help convert Python 2 code to Python 3 code. Obviously this isn't going to fix the larger problem of not having supporting frameworks and libraries.

The selection of available Python 3 packages on pypi is slim but growing. Some important web application frameworks like Django and Twisted are missing. Developers that rely on these frameworks obviously aren't going to adopting Python 3 anytime soon. So why aren't these frameworks adopting Python 3? Because it is hard. It isn't exactly trivial to build a well-established, stable framework even in Python 2 which has been around for a while. Most of these frameworks will be Python 3 based at some point in the future while others probably have no intention of adoption.

In the mean time, write some Python 3 code that doesn't rely on frameworks. This is probably the best way to get familiar with the language. If you know another Python developer, show them some cool things you get working in Python 3. Also show them stuff that doesn't work. This all leads to more Python 3 code coming into existence. This could be a good opportunity to write a new framework for Python 3. Remember, there are many benefits brought about by the changes made in Python 3 that outweigh the familiarity of constructs you're used to using in Python 2.