On Sat, Jun 12, 2010 at 12:55:25AM +0530, Zubin Mithra wrote: > I just discovered that the following construct does not work in Py3k. > > >>> string.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
That is because, string is unicode in py3k and maketrans is for former 8bit string. Actually, its got to do with semantics, that is why 2to3 can't help you here. BTW, you might this example helpful for your understanding. http://uthcode.sarovar.org/pycon2010/strings.html#string-translate-method-and-maketrans-function > 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. 2to3 is a context free source to source translation tool. It is very comprehensive. It requires a good skills in Compilers if you were to write something more than that. -- Senthil _______________________________________________ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers