Path: csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!news2.euro.net!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.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:Python': 0.06; '(except': 0.07; 'string': 0.09; 'invalidate': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject: [': 0.09; 'subject:string': 0.09; 'python': 0.11; 'jan': 0.12; 'how,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'why,': 0.16; 'wrote:': 0.18; 'header:User- Agent:1': 0.23; 'error': 0.23; 'subject:/': 0.26; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; "d'aprano": 0.31; 'steven': 0.31; 'created': 0.35; 'subject:new': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'does': 0.39; 'supporting': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'users': 0.40; 'even': 0.60; 'received:173': 0.61; 'such': 0.63; 'believe': 0.68; 'containing': 0.69; 'legal': 0.71; 'c-api': 0.84; 'complexity': 0.84; 'extensions.': 0.84; 'nice,': 0.84; 'received:fios.verizon.net': 0.84; 'subject:long': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Surrogate pairs in new flexible string representation [was Re: flaming vs accuracy [was Re: Performance of int/long in Python 3]] Date: Fri, 29 Mar 2013 14:06:40 -0400 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> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-251-66.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 In-Reply-To: <5154fe82$0$29974$c3e8da3$5496439d@news.astraweb.com> 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: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1364580449 news.xs4all.nl 6843 [2001:888:2000:d::a6]:49116 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:42262 On 3/28/2013 10: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? I believe because surrogates are legal codepoints and users may put them in strings even though python does not (except for surrogate_escape error handling). I believe some of the internal complexity comes from supporting the old C-api so as to not immediately invalidate existing extensions. -- Terry Jan Reedy