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 gmail.com
Thu Mar 28 22:44:50 EDT 2013


On Fri, Mar 29, 2013 at 1:37 PM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> 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.

ChrisA



More information about the Python-list mailing list