[Python-Dev] PEP 393 Summer of Code Project
Victor Stinner
victor.stinner at haypocalc.com
Wed Aug 24 00:56:48 CEST 2011
Le mercredi 24 août 2011 00:46:16, Victor Stinner a écrit :
> Le lundi 22 août 2011 20:58:51, Torsten Becker a écrit :
> > [1]: http://www.python.org/dev/peps/pep-0393
>
> state:
> lowest 2 bits (mask 0x03) - interned-state (SSTATE_*) as in 3.2
> next 2 bits (mask 0x0C) - form of str:
> 00 => reserved
> 01 => 1 byte (Latin-1)
> 10 => 2 byte (UCS-2)
> 11 => 4 byte (UCS-4);
> next bit (mask 0x10): 1 if str memory follows PyUnicodeObject
>
> kind=0 is used and public, it's PyUnicode_WCHAR_KIND. Is it still
> necessary? It looks to be only used in PyUnicode_DecodeUnicodeEscape().
If it can be removed, it would be nice to have kind in [0; 2] instead of kind
in [1; 2], to be able to have a list (of 3 items) => callback or label. I
suppose that compilers prefer a switch with all cases defined, 0 a first item
and contiguous values. We may need an enum.
Victor
More information about the Python-Dev
mailing list