PyCon is just a couple of weeks away, and I haven’t gotten around to designing a poster for my session yet. I’m open to suggestions for what people would like to see (though I won’t hold out for them, of course).
I also haven’t written any 3to2 code since my last update — I haven’t heard anything from anyone using it yet. I’m still going to stick with the first beta release being when fix_imports2 works, which may be a (legitimate) reason that people aren’t using it enough to have feedback to give about it. I’m not coding as actively right now because of other priorities — but if I get feedback from users, I may be more inclined to prioritize 3to2 higher than it currently is.
I have decided to keep with the idea of having a fix_imports2 separate from fix_imports, so after finishing the usage parts of fix_imports_test, I have declared it finished and ready for general usage. It has replaced the old fix_imports.
fix_imports2 will be another rewrite, so I will go ahead and start on that eventually.
Finals week has started, and I already only have one more exam (on Friday).
I have done a little bit of work on the new fix_imports replacement, and I think that it will turn out to be much cleaner than the sloppy ones in the trunk right now.
Other updates:
I will be doing a poster session at PyCon 2010 about 3to2, so stay tuned for updates about that.
So I’ve gotten the first part of the rewrite for fixing code with imports working… (from) (http) (import) (client) goes to (import) (httplib) (as) (client)
I wrote this particular one for playing around with one of the complicated cases using the new pattern builder… I’ll toy around with it some more for the simple cases.
I’ve committed the first bit of a rewrite for fix_imports and fix_imports2. Short description: the plan is to use the 2to3 pattern matcher instead of a custom hack to improve speed, correctness, and simplicity.
Long description:
fix_imports2 literally scans the tree before anything happens, collecting relevant NAME leaves into a dict mapping top-level modules (e.g., urllib) to them.
fix_imports is another great example of bad code if anyone was looking for one.
I haven’t had the large chunk of time that it would take to do a rewrite until now. Hoping I can get it done by the end of Thanksgiving break, though that’s a little optimistic.
I’ve gotten the Extended Iterable Unpacking fixer to work in suites.
Also, I’m going to fill out an application to do a poster about 3to2 at PyCon 2010… here’s hoping!
More nothing, because my spending so much time on Statistics caused me to neglect other endeavours, so I’ve had to catch up on those things. I’m so busy…
Since last week when I finished the article, I have not touched 3to2, in favor of other academic efforts… classes are at their peak at this point. I will *probably* start writing some more code after my midterm on Monday (Nov 9).
I am proud to announce the third alpha release of 3to2: 0.1a3. Release notes can be found in the RELEASE file.
Note that the Python 3.1 branch requires patching lib2to3 to be able to run the unpacking fixer, which is disabled by default for this reason. If you have no problems patching lib2to3 in this way and wish to have the fixer enabled by default, you may manually edit lib3to2/fixes/fix_unpacking.py and delete the line that says “explicit = True” before running setup.py. (If you do this after running setup.py, then you will have to run it again.)
New to this version of 3to2 is a slightly enhanced Makefile. Users of UNIX-like machines can run “make install-local” to install 3to2 to $HOME/.local, “make test-local” to install 3to2 locally and run the test suite, and “make uninstall-local” to remove 3to2’s presence from $HOME/.local
Python 2.7: gzipped tarball is available at bitbucket, and there is also a mercurial branch of the source. 2.7 releases will be tagged versions of the trunk.
Python 3.1: gzipped tarball is available at bitbucket (if you downloaded this before 4:00 PM EDT today (Oct 28), please re-download. It has been updated. Thank bitbucket.), and there is also a mercurial branch of the source. 3.1 releases will be discreet, as 2to3 is run on the 2.7 branch every release.
Also new to this version is a PyPI registration for the 3.1 branch.
One final note I want to make is that the 3.1 branch can be installed side-by-side with the 2.7 branch, as the 3.1 branch calls the 3to2 executable “3to2_31″. I don’t think that I want to change that, but please let me know if this seems like too much of a burden, as I am open to completely turning 3to2 upside-down based on feedback from the (majority of the) community.
So my 3to2 article for PyMag has been submitted with the first set of technical revisions. I have been hinted that it may show up as soon as the October edition, but I think that remains to be seen.
During the process of writing it, I found another bug and some inconsistencies with the documentation that I fixed up… heh.