Test cases work now, thanks to a recent patch to 2to3 making it more generic. The patch has not yet been merged with Python, so Lib/lib2to3 has to be symlinked to lib2to3 from http://svn.python.org/projects/sandbox/trunk/2to3/ in order for 3to2 tests to work.
May 29, 2009
May 27, 2009
Couple of days now
I’ve been working for a few days now, and things are going pretty well. I’m having some problems reusing lib2to3 code for my project, as much of it seems to be very deeply embedded in with 2to3 and not easily detachable to work for my purposes (e.g., I think I will have to completely rewrite some of the test case support, as I cannot get my tests to run using the framework provided in lib2to3).
So far, I have fixers for input(…) -> raw_input(…) and range(…) -> xrange(…). These are really that simple in terms of usage cases, but more can be done: eval(input(…)) in py3k can be changed to input(…) in Python 2.x, instead of doing eval(raw_input(…)), and list(range(…)) can just turn into range(…) in Python 2.x. These will work for now, however.
I accidentally added some temporary files to my repository (i.e., placeholder input() and range() test files and a very crappy fix_range.py that wasn’t even properly working yet). Sorry about that!
Finally, I have been scratching my head for too long today about getting the test case support to work. I’m just going to push what I have, then go to bed to start early tomorrow!
May 22, 2009
Ready to start
Tomorrow is the official start date. I have created a repository for my work at http://bitbucket.org/amentajo/lib3to2