Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.034 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'subject:Python': 0.06; 'string': 0.09; 'bytes.': 0.09; 'subject: [': 0.09; 'subject:string': 0.09; 'api': 0.11; 'python': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'how,': 0.16; 'why,': 0.16; 'wrote:': 0.18; 'string,': 0.24; 'subject:/': 0.26; 'header:In-Reply-To:1': 0.27; 'message- id:@mail.gmail.com': 0.30; "d'aprano": 0.31; 'steven': 0.31; 'another': 0.32; 'fri,': 0.33; 'sense': 0.34; 'received:209.85': 0.35; 'created': 0.35; 'received:google.com': 0.35; 'received:209': 0.37; 'subject:new': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'around.': 0.60; 'most': 0.60; 'such': 0.63; 'mar': 0.68; 'containing': 0.69; "it'd": 0.84; 'nice,': 0.84; 'subject:long': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=0L2F5RGaL4ozcmcnOxjcQMaeHDdL5UtzEuDG5VafUrQ=; b=jBe+Ax+MjksYjqtG7I70uNE7sYOp+gG61R5y35Q4dZ5hFaJm6K/vaRRCTR9auHCKlX dbxIoG9OCL/YGgZP2zoPO4juGv+n4zvHSSM8IQQkffyii6aFtHid4j7tDS3U1IgZSGuj nRu6WSeLz+PxsRDPCwTfeCiOiOEEoS0AAzwHEjjeZr6Ap/abf3Z2uSeV5HA1CsMv0w9s Nz3SDsqNAO0n+FQW7SyJtypjamc8MGPR2f3weik9BOCAwl0b7XIuhcHrEt02ahVSYWFy OWTIXIaw4NcbvoikhFp4OZD+EWl9OnWDAgcNNbKo5pyzQMXCkuDISrxwNRW/UCpJx36F 3EcA== MIME-Version: 1.0 X-Received: by 10.52.67.164 with SMTP id o4mr670985vdt.42.1364525090216; Thu, 28 Mar 2013 19:44:50 -0700 (PDT) In-Reply-To: <5154fe82$0$29974$c3e8da3$5496439d@news.astraweb.com> References: <5153a12d$0$29998$c3e8da3$5496439d@news.astraweb.com> <987c4bd9-0e5e-4387-9c78-1075a77d3c47@c6g2000yqh.googlegroups.com> <51543f45$0$29998$c3e8da3$5496439d@news.astraweb.com> <944f195c-cbfe-47e1-a963-05fe3d98238d@5g2000yqz.googlegroups.com> <5154e2dd$0$29974$c3e8da3$5496439d@news.astraweb.com> <5154fe82$0$29974$c3e8da3$5496439d@news.astraweb.com> Date: Fri, 29 Mar 2013 13:44:50 +1100 Subject: Re: Surrogate pairs in new flexible string representation [was Re: flaming vs accuracy [was Re: Performance of int/long in Python 3]] From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1364525092 news.xs4all.nl 6904 [2001:888:2000:d::a6]:41916 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:42215 On Fri, Mar 29, 2013 at 1:37 PM, Steven D'Aprano 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