[Python-Dev] Is this safe enough? Re: [Python-checkins] cpython: _Py_Identifier are always ASCII strings (original) (raw)

Antoine Pitrou solipsis at pitrou.net
Mon Feb 6 22:59:36 CET 2012


On Mon, 6 Feb 2012 22:57:46 +0100 Victor Stinner <victor.stinner at haypocalc.com> wrote:

>> -        id->object = PyUnicodeDecodeUTF8Stateful(id->string, >> -                                                  strlen(id->string), >> -                                                  NULL, NULL); >> +        id->object = unicodefromascii((unsigned char*)id->string, >> +                                       strlen(id->string)); This is just an optimization.

Is the optimization even worthwhile? This code is typically called once for every static string.

Regards

Antoine.



More information about the Python-Dev mailing list