scipy/scipy — pull request #397 by pv (2013-01-05 18:57:41+00:00)
Title: Get rid of 2to3

This PR converts the code base so that it runs both on Python >= 2.6 and 3.x, without any conversions needed.

The size of the diff is smaller than what I expected, and is maybe possible to review as a single chunk... Some more testing is probably needed, but the test suite passes and I didn't see in the first pass anything too suspicious remaining. Discussion on the ML is probably required before merging.

The majority of changes are relative imports, changing print statements to print(), inserting list() to correct locations, and dealing with dissappearing unicode and unicode literals. The conversion was done by first taking the 2to3 results, and then back-porting that to Python 2, trimming out unnecessary changes.

The `six` compatibility module is also now bundled to deal with some compatibility issues.

The impact for further development would be that new code written should run as-is both on Python 2.6 and 3.x. The main annoyance for scipy code are probably the changed semantics of map(), zip(), keys() et al., which requires using list() in correct places. The other Python 3 issues are probably of not much consequence.

The upside of this change is un-ghettoization of Python 3, and getting rid of the build-time conversion process (which has its own annoyances).