Re: [Sqlalchemy-tickets] [sqlalchemy] #2671: in place codebase for py2x, py3x
Brought to you by:
zzzeek
|
From: sqlalchemy <mi...@zz...> - 2014-01-03 16:51:44
|
#2671: in place codebase for py2x, py3x
-----------------------------------+--------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: task | Status: closed
Priority: medium | Milestone: 0.9.0
Component: (none) | Severity: refactor - over two days
Resolution: fixed | Keywords:
Progress State: completed/closed |
-----------------------------------+--------------------------------------
Comment (by zzzeek):
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".
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2671#comment:3>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|