I’ve been pulled away from GSoC so much over the past few weeks that I have actually fallen a little behind. So, over the next few days, I plan to finish everything that is left. Starting when I finish one last physics problem (which is, at the latest, midnight Friday) (approximately 24 hours from this post), I plan to dedicate the week-end to nothing but coding and the personal necessities. My goal is to have the following completed by the end of the week-end:
- done.. fix_imports also fixes the usage of the names imported (at time of writing, it only fixed the import)
- done.. most of fix_imports2, a fixer that deals with multiple modules that were merged into a single module (at the minimum, the “from x import y” component)
- done.. fix_features, a fixer that will warn the user which code cannot be converted syntactically because of new py3k features
- not done.. (time-permitting) fix_print works for real (currently only adds “from __future__ import print_function”, which caps the python2.x version at 2.6 if there is a print)
I really think I can pull this off this week-end. It will take just the right combination of Mountain Dew and my ADD meds. And a DND message.
Also, barring catastrophic failure of reaching those goals, that will bring me very close to the end of the project. The ample amounts of ahead-of-schedule time I had at the beginning have been brought in check by ever-increasingly difficult physics homework and the more-than-occasional free time to spend with Kristina. By August 10 (suggested pencils-down date), barring acts of $DEITY, I should be prepared to do some more documentation, clean up the code, make sure my test suite is thorough, etc. to be prepared for the August 17 deadline.
Edit:
fix_imports2 should now be done, as far as (from x import y) is concerned. It requires a heck of a lot more testing than my few test cases, though. In any case, my weekend goal is now complete! (with the exception of fix_print refactoring, as I did not end up having the extra time to do it) Final challenges are:
- fix_imports2 needs to work for (import x) and (from x import *) imports.
- The code needs to be more readable (ongoing process).
- Need to remind myself what I needed to do with itertools. Fixed in changeset e343ee635f0b
- Add in 3.1 features to fix_features.
- Test cases, test cases, test cases!!! If anyone can help with this, I would really appreciate it! Even just a link to a really comprehensive piece of py3k software to look at would help out tremendously.
Scary side note… I started running 3to2 on some packages from pypi, and I found that there was an error in fix_setliteral that crashed the interpreter when running any sufficiently complex code: in order for it to differentiate between a set literal and a dict literal, it ran eval() on a line and checked for a SyntaxError. Of course, this would also generate a NameError if that line contained any names previously defined by the module.
That hack has been removed, and 3to2 actually works on code now.
Comment by AirBreather — August 5, 2009 @ 3:15 am