[Python-Dev] Unicode charmap decoders slow

"Martin v. Löwis" martin at v.loewis.de
Wed Oct 5 08:47:54 CEST 2005

Tony Nelson wrote:
 > But is there really no way to say this fast in pure Python?  The way a
 > one-to-one byte mapping can be done with "".translate()?

Well, .translate isn't exactly pure Python. One-to-one between bytes
and Unicode code points simply can't work. Just try all alternatives
yourself and see if you can get any better than charmap_decode.

Some would argue that charmap_decode *is* fast.


More information about the Python-Dev mailing list