[Python-Dev] PEP 393 Summer of Code Project

Stephen J. Turnbull stephen at xemacs.org
Tue Aug 30 19:22:25 CEST 2011


Antoine Pitrou writes:
 > On Mon, 29 Aug 2011 12:43:24 +0900
 > "Stephen J. Turnbull" <stephen at xemacs.org> wrote:
 > > 
 > > Since when can s[0] represent a code point outside the BMP, for s a
 > > Unicode string in a narrow build?
 > > 
 > > Remember, the UCS-2/narrow vs. UCS-4/wide distinction is *not* about
 > > what Python supports vs. the outside world.  It's about what the str/
 > > unicode type is an array of.
 > 
 > Why would that be?

Because what the outside world sees is produced by codecs, not by
str.  The outside world can't see whether you have narrow or wide
unless it uses indexing ... ie, experiments to determine what the str
type is an array of.

The problem with a narrow build (whether for space efficiency in
CPython or for platform compatibility in Jython and IronPython) is not
that we have no UTF-16 codecs.  It's that array ops aren't UTF-16
conformant.


More information about the Python-Dev mailing list