[Python-Dev] 3to2 Project

Collin Winter collinw at gmail.com
Mon Mar 30 19:37:47 CEST 2009

On Mon, Mar 30, 2009 at 7:44 AM, Jesse Noller <jnoller at gmail.com> wrote:
> During the Language summit this past Thursday, pretty much everyone
> agreed that a python 3 to python 2 tool would be a very large
> improvement in helping developers be able to write "pure" python 3
> code. The idea being a large project such as Django could completely
> cut over to Python3, but then run the 3to2 tool on the code based to
> continue to support version 2.x.
> I raised my hand to help move this along, I've spoke to Benjamin
> Peterson, and he's amendable to mentoring a GSoC student for this
> project and he's  already received at least one proposal for this.
> Additionally, there's been a number of developers here at PyCon who
> are more than ready to help contribute.
> So, if people are interested in helping, coordinating work/etc - feel
> free to sync up with Benjamin - he's started a wiki page here:
> http://wiki.python.org/moin/3to2

If anyone is interested in working on this during the PyCon sprints or
otherwise, here are some easy, concrete starter projects that would
really help move this along:
- The core refactoring engine needs to be broken out from 2to3. In
particular, the tests/ and fixes/ need to get pulled up a directory,
out of lib2to3/.
- Once that's done, lib2to3 should then be renamed to something like
librefactor or something else that indicates its more general nature.
This will allow both 2to3 and 3to2 to more easily share the core
- If you're more performance-minded, 2to3 and 3to2 would benefit
heavily from some work on the pattern matching system. The current
pattern matcher is a fairly simple AST interpreter; compiling the
patterns down to pure Python code would be a win, I believe. This is
all pretty heavily tested, so you wouldn't run much risk of breaking


More information about the Python-Dev mailing list