Differences between revisions 4 and 5
Revision 4 as of 2009-05-29 20:36:16
Size: 1035
Editor: d27-96-105-34
Comment:
Revision 5 as of 2010-07-05 21:20:50
Size: 981
Editor: 40
Comment: Update
Deletions are marked like this. Additions are marked like this.
Line 11: Line 11:
 and that would get translated to 
 
 and that would get translated to
Line 17: Line 17:
* Some people have expressed an interest in seeing a 3to2 tool which would make 3.x code valid for ~2.5. This is in the nonexistent stage, so you'd have to start writing fixers from scratch. * Some people have expressed an interest in seeing a 3to2 tool which would make 3.x code valid for ~2.5. Work is in progress, see [[3to2]]

2to3 is a tool that automatically translates 2.x code to 3.x code. The code is located at http://svn.python.org/view/sandbox/trunk/2to3. At the moment, it is principally maintained by BenjaminPeterson.

Here are some project ideas:

* Some people have expressed interest in adding directives in the source to 2to3. So you could write:

  •  # 2to3: strings-are-bytes
     x = "hi"
     # 2to3: end
    and that would get translated to

    x = b"hi"

* Last year there was a project to add confidence rankings to 2to3 changes. People could configure them to a certain level and deal with low confidence refactoring manually (or interactively). For some reason, the project was never finished. If you want to find more out about that, I suggest you contact the student or his mentor, Collin Winter.

* Some people have expressed an interest in seeing a 3to2 tool which would make 3.x code valid for ~2.5. Work is in progress, see 3to2

2to3 (last edited 2011-03-25 09:14:31 by techtonik)

Unable to edit the page? See the FrontPage for instructions.