[BangPypers] 2to3 fixers

Zubin Mithra zubin.mithra at gmail.com
Fri Jun 11 21:25:25 CEST 2010


Hey everyone,

I just discovered that the following construct does not work in Py3k.

>>> string.maketrans('-', '_')

However, the following works,

>>> str.maketrans('-', '_')

When i try to convert a python module containing the above construct,
it does not get modified in a way such that it could run on Python 3.0

I`m trying to automate the conversion of making the module Py3k
compatible and so I guess i`m left with two options.

1. replace string.maketrans() with a function which is compatible in
both Python 2.x and 3.0 ; as of now I`m unaware of such a construct.

2. write a fixer for doing this which I could use. I could`nt find any
good tutorials out there on writing fixers, i`d be grateful if you
could point me to any.

Thankx in advance,
cheers
zubin


More information about the BangPypers mailing list