2008-12-06

Getting help with porting your code to Python 3.0

It seems the biggest worry people have with Python 3.0 is either the work required to port their libraries for users and not being sure it is worth the effort, or users over their libraries not being ported. Notice the catch-22?

But if there is one thing I want people to get out of this blog post is to realize they should not get into a gloom-and-doom feeling that their libraries will never be ported over or that library developers can't get a port done. That leads to people ignoring Python 3.0. So please stay positive!

With that said, what can people do? If you are a library developer you have help. First, you can subscribe to the python-porting list to get help and tips on how to port. For instance, Martin v. Löwis has already given tips he used to port psycopg2 to 3.0 on his own. You can also obviously ask the community for help. Porting is a pretty good intro project for someone who has never contributed before.

What if you are a library user? The biggest thing you can do is help! If you have a library you use and it has not been ported, then help do the port. But if that is too much then consider asking if a port is going to be done to help encourage the library developer to get the ball rolling on it. And to help find out what has been ported you can look at PyPI's 3.0 list . The list is currently short as people need to explicitly set their Trove classifier to include 3.0 support and those classifiers were only added back in mid-October.

But as I said, I just don't want library developers to feel like they can't get help from their communities and library users to think they libraries will never be ported. Either line of thinking leads to people giving up too soon on Python 3.0 and I think that would be a shame.

And to show I am not all talk, I updated pep362 to support 3.0 final and set the proper Trove classifiers for what versions of Python it supports. And just as an aside about pep362, if you really feel the need to type-check arguments to a function, the examples.py file in the package includes a decorator that does just that.