Path: csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.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.021 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'subject:Python': 0.06; 'string': 0.09; 'optimizing': 0.09; 'subject: [': 0.09; 'stored': 0.12; '(something': 0.16; 'bits.': 0.16; 'character.': 0.16; 'encodings': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'three:': 0.16; 'wrote:': 0.18; 'fit': 0.20; 'byte': 0.24; 'bytes': 0.24; 'options': 0.25; 'shown': 0.26; 'subject:/': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'languages': 0.32; 'option': 0.32; 'fri,': 0.33; 'received:209.85': 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'european': 0.36; 'detail': 0.37; 'two': 0.37; 'received:209': 0.37; 'subject:]': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'mar': 0.68; 'optimized': 0.68; 'safe': 0.72; 'examples.': 0.84; 'subject:long': 0.84; 'western': 0.86; '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=UkjnFIHc/TMKUgW72G1APOoeuuwJsys+fNEWq9WrLU0=; b=KE22qKvQEz2JRQjBIjbSSEx+BfsZHB9RXQm+P0DQnNI7LpfYQr/ufE4fuHo57G8g9k i8x0LJDVdDjJuy9S+XnMTeH8jkDj3YlJvqekk8dWfGl0uS/8mZs8sZNo21fcYGv0zqD1 1/SWC6qq1HEqSRziz2/9snJ4AZFqgQ75GJ+oanr4WGMAo/MSA/SXrjcgtkXIZbJAjGWd Vv5V+RrGGl8zP5HeiC0EEMXNLWfGocBYp3plzw2OQVX0FdO3DxMl9zck/5Ae9m6ePHkM TPfw8E0jXY7qtePSZ7PSSv5bdDKezK2dNgU2XHeu6HITpl0KAmkhpxI1cpcEpvokkJoH ITow== MIME-Version: 1.0 X-Received: by 10.220.231.199 with SMTP id jr7mr27060055vcb.70.1364481487280; Thu, 28 Mar 2013 07:38:07 -0700 (PDT) In-Reply-To: <944f195c-cbfe-47e1-a963-05fe3d98238d@5g2000yqz.googlegroups.com> 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> <51543f45$0$29998$c3e8da3$5496439d@news.astraweb.com> <944f195c-cbfe-47e1-a963-05fe3d98238d@5g2000yqz.googlegroups.com> Date: Fri, 29 Mar 2013 01:38:07 +1100 Subject: 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: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1364481489 news.xs4all.nl 6848 [2001:888:2000:d::a6]:55134 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:42130 On Fri, Mar 29, 2013 at 1:12 AM, jmfauth wrote: > This flexible string representation is so absurd that not only > "it" does not know you can not write Western European Languages > with latin-1, "it" penalizes you by just attempting to optimize > latin-1. Shown in my multiple examples. PEP393 strings have two optimizations, or kinda three: 1a) ASCII-only strings 1b) Latin1-only strings 2) BMP-only strings 3) Everything else Options 1a and 1b are almost identical - I'm not sure what the detail is, but there's something flagging those strings that fit inside seven bits. (Something to do with optimizing encodings later?) Both are optimized down to a single byte per character. Option 2 is optimized to two bytes per character. Option 3 is stored in UTF-32. Once again, jmf, you are forgetting that option 2 is a safe and bug-free optimization. ChrisA