Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'utf-8': 0.07; 'string': 0.09; 'strings.': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'jan': 0.12; '3.3,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'internally': 0.16; 'pairs': 0.16; 'surrogate': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; "python's": 0.19; '(the': 0.22; 'cc:addr:python.org': 0.22; 'aspect': 0.24; 'byte': 0.24; 'comparing': 0.24; 'unicode': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'specifically': 0.29; 'character': 0.29; 'message-id:@mail.gmail.com': 0.30; "d'aprano": 0.31; 'steven': 0.31; 'except': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'data,': 0.36; 'pm,': 0.38; 'either': 0.39; 'subject:"': 0.60; 'email addr:gmail.com': 0.63; 'holding': 0.65; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=wbbyHijaru83Jgq4uil/eqe0SjPGo3wXJdBvHG/BZ70=; b=NK2HDJil4ffCoMQ1/iXu0MI7UMQhYUTjK0aBURQdJyPRhGjalRmRtko/zC0hFyjBVC Zas8W337GoK94+0DUzH83WRN7qVNezbEwgSm7ucFZmCc/N+FWvJ1gDP7Jz4/sc/w1dUe l8woxVBjHRVDiPUsxacYz700AZQiNbkdZSHn5ihSlH/Go+/gwKzwWwW8dAcoQ/YjVx0v EXSqzeoum7Q0uYjMcg4MrggpzLVsO1TZWehFvRvZeuU6wiXcv2yGd8EJhy/GXYe9Dqpm i7fKYPi1o8mWhMlNmmFyENT73vCDolBdEJlUySl8Ji6WLQ8pgPCOissQrB/+gVZuVbBf Sywg== MIME-Version: 1.0 X-Received: by 10.68.130.130 with SMTP id oe2mr109959784pbb.135.1388890469975; Sat, 04 Jan 2014 18:54:29 -0800 (PST) In-Reply-To: <52c8c650$0$9505$c3e8da3$5496439d@news.astraweb.com> References: <52c1dc4c$0$2877$c3e8da3$76491128@news.astraweb.com> <52C1F5EC.3020808@stoneleaf.us> <52c29416$0$29987$c3e8da3$5496439d@news.astraweb.com> <52C5A3BA.5080700@chamonix.reportlab.co.uk> <7978ffc2-8e6a-40b2-a4c7-66990d6af1be@googlegroups.com> <52c8c650$0$9505$c3e8da3$5496439d@news.astraweb.com> Date: Sun, 5 Jan 2014 13:54:29 +1100 Subject: Re: Blog "about python 3" From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1388890479 news.xs4all.nl 2921 [2001:888:2000:d::a6]:41958 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:63164 On Sun, Jan 5, 2014 at 1:41 PM, Steven D'Aprano wrote: > wxjmfauth@gmail.com wrote: > >> The very interesting aspect in the way you are holding >> unicodes (strings). By comparing Python 2 with Python 3.3, >> you are comparing utf-8 with the the internal "representation" >> of Python 3.3 (the flexible string represenation). > > This is incorrect. Python 2 has never used UTF-8 internally for Unicode > strings. In narrow builds, it uses UTF-16, but makes no allowance for > surrogate pairs in strings. In wide builds, it uses UTF-32. That's for Python's unicode type. What Robin said was that they were using either a byte string ("str") with UTF-8 data, or a Unicode string ("unicode") with character data. So jmf was right, except that it's not specifically to do with Py2 vs Py3.3. ChrisA