in place codebase for py2x, py3x

Issue #2671 resolved
Mike Bayer repo owner created an issue

this is the major initiative for 0.9. I want to start with this task.

Comments (5)

  1. ‮rekcäH nitraM‮

    Out of interest, do you have a link that describes the practices you followed to achieve this? I'd imagine that this could be a good template for our efforts. :-)

  2. Mike Bayer reporter

    well I didn't do exactly what Armin talks about here: http://lucumr.pocoo.org/2013/5/21/porting-to-python-3-redux/ though that's kind of the background. I started with the 2to3 version of the code, and then cleaned it up. This approach has some major issues which is that a lot of the 2to3 fixes are not what we want, and are very hard to search and replace, most notably it turning "basestring" into "str". #2901 is an example of one I missed, causing a regression. 2to3 allows custom fixers which is probably what "python-modernize" is doing. Unlike Armin I'm still trying to keep 3.1/3.2 working so I had to do some more work with strings.

    the best approach would probably be something like starting out with your "compat" layer, which you definitely need (ours is sqlalchemy/util/compat.py) and then rigging up a 2to3-like tool that writes out your "compat".

  3. Log in to comment