[Python-Dev] bytes (original) (raw)

[Python-Dev] bytes / unicode

Mike Klaas mike.klaas at gmail.com
Wed Jun 23 02:39:04 CEST 2010


On Tue, Jun 22, 2010 at 4:23 PM, Ian Bicking <ianb at colorstudy.com> wrote:

This reminds me of the optimization ElementTree and lxml made in Python 2 (not sure what they do in Python 3?) where they use str when a string is ASCII to avoid the memory and performance overhead of unicode.

An optimization that forces me to typecheck the return value of the function and that I only discovered after code started breaking. I can't say was enthused about that decision when I discovered it.

-Mike



More information about the Python-Dev mailing list