Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed3.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'url:pypi': 0.03; 'encoding': 0.05; 'subject:Python': 0.06; 'indexing': 0.07; 'utf-8': 0.07; 'string': 0.09; 'compact': 0.09; 'subject: [': 0.09; 'encoding.': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'message- id:@mrabarnett.plus.com': 0.16; 'reason.': 0.16; 'subject: \n ': 0.16; 'wrote:': 0.18; 'module': 0.19; 'implementing': 0.19; "python's": 0.19; 'seems': 0.21; 'header:User-Agent:1': 0.23; 'subject:/': 0.26; 'header:In-Reply-To:1': 0.27; 'character': 0.29; 'url:python': 0.33; 'common': 0.35; 'operations': 0.35; 'url:org': 0.36; 'subject:]': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'ian': 0.60; 'impact': 0.61; 'more': 0.64; 'header:Reply-To:1': 0.67; 'benefit': 0.68; 'reply-to:no real name:2**0': 0.71; 'reply-to:addr:python.org': 0.84; 'subject:long': 0.84 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.0 cv=XeZXOvF5 c=1 sm=1 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=B68SgI_Jlq8A:10 a=d5osE0Bd0hoA:10 a=ihvODaAuJD4A:10 a=OUOv7kDek9cA:10 a=8nJEP1OIZ-IA:10 a=EBOSESyhAAAA:8 a=8AHkEIZyAAAA:8 a=ZSPP0T9P_JwA:10 a=r0TVJofZsZmAk6hhJ8cA:9 a=wPNLvfGTeEIA:10 a=SzTMvBZ9WUESQ2on:21 a=Gw2rsS2A5HrD2Zih:21 a=0nF1XD0wxitMEM03M9B4ZQ==:117 X-AUTH: mrabarnett:2500 Date: Thu, 28 Mar 2013 14:51:56 +0000 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 MIME-Version: 1.0 To: python-list@python.org Subject: Re: flaming vs accuracy [was Re: Performance of int/long in Python 3] References: <0b779c80-4f50-4716-8c30-47755c15f304@m12g2000yqp.googlegroups.com> <5153a12d$0$29998$c3e8da3$5496439d@news.astraweb.com> <987c4bd9-0e5e-4387-9c78-1075a77d3c47@c6g2000yqh.googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: python-list@python.org 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: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1364482498 news.xs4all.nl 6959 [2001:888:2000:d::a6]:45374 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:42137 On 28/03/2013 12:11, Neil Hodgson wrote: > Ian Foote: > >> Specifically, indexing a variable-length encoding like utf-8 is not >> as efficient as indexing a fixed-length encoding. > > Many common string operations do not require indexing by character > which reduces the impact of this inefficiency. UTF-8 seems like a > reasonable choice for an internal representation to me. One benefit > of UTF-8 over Python's flexible representation is that it is, on > average, more compact over a wide set of samples. > Implementing the regex module (http://pypi.python.org/pypi/regex) would have been more difficult if the internal representation had been UTF-8, because of the need to decode, and the implementation would also have been slower for that reason.