2to3

Talks | Submit a talk
Authors Zubin Mithra
Level Intermediate
Topic Core Python (including Python 3.x)
Tags python3k, porting
Summary

Python3.1 has been out for more than an year now, and many popular distributions are yet to be ported from Python2.x over to Python3k. This is mostly because of the 'my-dependencies-arent-ported-whose-dependencies-arent-ported' problem; and this forms a vicious circle. In most cases, porting a Python codebase from 2to3 is not that complicated, but a lot of community effort would be needed in order for this to work out quickly.

The talk introduces the 2to3 tool, the strategy used by the author to port the Distutils2 codebase over to Python3k and encourages Python developers to move over to Python3k and help the community do the same.

Outline
  1. How different is Python3k?
  2. A tool named 2to3 to help port?! nice!
  3. This is how I went about porting Distutils2 ...
  4. Do I have to maintain two branches for my project? One for 2.x and another for 3k? :(
  5. I wish to help the community move over to Py3k, what do I do?
    • host sprints(PSF sponsors sprints, hope you know about that!)
    • help out at the Python-porting ML
    • help port libraries(duh!)
  6. Under-the-hood
    • how exactly strings are handled in Python3k
    • how exactly integers are handled in Python3k
Notes

Talk length - Sections 1,2,4, and 5 will take 20 minutes. 3 and 6 are expected to take another 20 minutes. 5 minutes for clearing doubts, if any.

Section 1 is more about which corresponding idiom to use in Py3 instead of 2.x; so there really is no concept being explained here. So, it can be brushed through quickly. Moreover, the slides of the talk will be made available online so that the viewers can re-check into the details later on.

Section 3 will be about the workflow I adopted while porting Distutils2 over to Python3k(I'll mention mercurial patch queues).

Section 4 will explain the various alternatives available for people who wish to port their libraries. They could have seperate codebases(in which case they have to apply bug fixes seperately to each branch) or they could have a single one(in which case they might end up having a messier codebase).

Section 6 will talk about how integers and strings are handled from the API onward, upward.

Profile of the authors

Zubin is a final year student pursuing a degree in Information Technology at the Amrita School Of Engineering, Kerala. Currently a Distutils contributor, he finds Django an interesting web-framework even though he is not primarily a web-developer. The Mercurial lover that he is, he has also written a few articles on the same for open-source magazines like Linux For You. Interested in the field of Information Security, Version Control, Concurrency issues and Compiler Design, he is currently completing his work on GSoC on behalf of the Python Software Foundation. He blogs at http://zubin71.wordpress.com

Files
file size uploaded comment
2to3-final2.pdf 986.4 KB september 25, 2010 the _final_ one ;-)
2to3-final.pdf 982.4 KB september 25, 2010 final version of the presentation
2to3.ppt 602.5 KB september 19, 2010 This presentation was originally made using Keynote and converted to Powerpoint later on(it has caused a few small formatting changes). I hope I will be able to demonstrate the presentation on my notebook, so that this will not be an issue. As of now, I have uploaded the ppt version of the same.

You can upload or delete a file if you are author of this talk.