[Python-Dev] str.translate vs unicode.translate (original) (raw)

M.-A. Lemburg mal at egenix.com
Fri Feb 17 14:24:51 CET 2006


Bengt Richter wrote:

If str becomes unicode for PY 3000, and we then have bytes as out coding-agnostic byte data, then I think bytes should have the str translation method, with a tweak that I would hope could also be done to str now.

BTW, str.translate will presumably become unicode.translate, so perhaps unicode.translate should grow a compatible deletechars parameter.

I'd much rather like to see .translate() method deprecated.

Writing a code for the task is much more effective - the builtin charmap codec will do all the mapping for you, if you have a need to go from bytes to Unicode and vice- versa.

We could also have a bytemap codec for doing bytes to bytes conversions.

-- Marc-Andre Lemburg eGenix.com

Professional Python Services directly from the Source (#1, Feb 17 2006)

Python/Zope Consulting and Support ... http://www.egenix.com/ mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/


::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::



More information about the Python-Dev mailing list