On Wed, Feb 23, 2011 at 4:07 PM, Guido van Rossum <gu...@python.org> wrote:
> I'm guessing that one of these encoding names is recognized by the C
> code while the other one takes the slow path via the aliasing code.

This is absolutely right.  In fact I am going to propose adding
strcmp(lower, "latin1") to the following test in
PyUnicode_AsEncodedString():


        else if ((strcmp(lower, "latin-1") == 0) ||
                 (strcmp(lower, "iso-8859-1") == 0))
            return PyUnicode_EncodeLatin1(...

I'll open a separate issue for that.  In Python's own stdlib and tests
"latin1" is a more common spelling than "latin-1", so it makes sense
to optimize it.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to