[Python-porting] Port of psycopg2
"Martin v. Löwis"
martin at v.loewis.de
Sat Dec 13 00:13:15 CET 2008
> The problem with this approach is that 2to3 is a fast moving target
> and relying on the version that comes with Python is likely not going
> to work out if you need a more recent version of 2to3 for your code.
So program against the version that comes with Python. I found that this
works quite well.
Of course, it worked best when you reported all problems you have in
your software before 3.0 was released.
> For source distributions this either means that you have to ship
> 2to3 with your code or that you ship already converted code.
>
> BTW: Is it possible to extend 2to3 with your own fixers dynamically,
> e.g. to work around this problem ?
Sure. You can pass explicit lists of fixers.
> Is there an overview of how lib2to3 works somewhere ?
How top-level do you want the overview to be? There is the fixes
directory, with one module per fixer. lib2to3 imports them all,
and then runs them one after another.
Regards,
Martin
More information about the Python-porting
mailing list