Surrogate pairs in new flexible string representation [was Re: flaming vs accuracy [was Re: Performance of int/long in Python 3]]

Chris Angelico rosuav at
Fri Mar 29 03:44:50 CET 2013

On Fri, Mar 29, 2013 at 1:37 PM, Steven D'Aprano
<steve+comp.lang.python at> wrote:
> Under what circumstances will a string be created from a wchar_t string?
> How, and why, would such a string be created? Why would Python still
> support strings containing surrogates when it now has a nice, shiny,
> surrogate-free flexible representation?

Strings are created from some form of content. If not from another
Python string, then - most likely - it's from a stream of bytes. If
from a C API that returns wchar_t, then it'd make sense to have that
form around.


More information about the Python-list mailing list