Joe Amenta's Blog

November 27, 2009

First steps towards fix_imports rewrite

Filed under: 3to2 — Tags: — AirBreather @ 12:19 pm

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.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress