[Python-Dev] UCS2/UCS4 default

Guido van Rossum guido at python.org
Thu Jul 3 19:10:07 CEST 2008


On Thu, Jul 3, 2008 at 10:01 AM, Jeroen Ruigrok van der Werven
<asmodai at in-nomine.org> wrote:
> What would the chances for inclusion in Python be if such a PEP + code would
> be presented Guido?

As long as it is clear that the len() function and the basic slicing
and indexing operations on strings continue to work in code units
(i.e. 16-bit quantities) and the APIs for dealing with code points
(i.e. treating surrogate pairs as a single character) are a separate
API, there is a chance. Existing code using the existing APIs should
not change its behavior (even if you consider the existing behavior
broken), with the exception of isalpha() and similar APIs, which can
IMO safely be extended to consider surrogate pairs.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list