Path: csiph.com!usenet.pasdenom.info!goblin1!goblin2!goblin.stu.neva.ru!newsfeed1.swip.net!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; ';-)': 0.03; 'example:': 0.03; 'programmer': 0.03; 'encoding': 0.05; 'received:134': 0.05; 'encoded': 0.07; 'utf-8': 0.07; 'bytes.': 0.09; 'exceeds': 0.09; 'strings.': 0.09; 'changes': 0.15; '"a"': 0.16; 'check.': 0.16; 'choice,': 0.16; 'implies': 0.16; 'possible?': 0.16; 'wider': 0.16; 'language': 0.16; '>>>': 0.22; 'header:User-Agent:1': 0.23; 'bytes': 0.24; 'header:In-Reply-To:1': 0.27; 'code': 0.31; 'container': 0.31; 'allows': 0.31; 'this.': 0.32; 'programmers': 0.33; 'problem.': 0.35; 'really': 0.36; 'should': 0.36; 'two': 0.37; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'email addr:gmail.com': 0.63; 'such': 0.63; 'choose': 0.64; 'charset:windows-1252': 0.65; 'between': 0.67; 'advantages': 0.68; 'designers': 0.74; '============': 0.84; 'pardon': 0.84; 'wish,': 0.91 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap4EAKfR+FGGuA9G/2dsb2JhbABbwieBLYMYAQEEATIBRQYLCyEWDwkDAgECAQ82EwYCAheHYwMJBq9xDVeIB40Ngj46FoNzA5V2gWmGEIYWhSaDFg Date: Wed, 31 Jul 2013 10:59:20 +0200 From: Antoon Pardon User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: python-list@python.org Subject: Re: RE Module Performance References: <51f14395$0$29971$c3e8da3$5496439d@news.astraweb.com> <51f15e03$0$29971$c3e8da3$5496439d@news.astraweb.com> <8203e802-9dc5-44c5-9547-6e1947ee224b@googlegroups.com> <43ce1b65-9d6d-47dd-b209-9a3bbafc0b8c@googlegroups.com> <51F7CFD1.1090403@rece.vub.ac.be> <51F7E634.2030200@mrabarnett.plus.com> <51F7EC41.5010704@rece.vub.ac.be> <51F7F48F.3070803@mrabarnett.plus.com> <39155ddf-437c-459e-ad7c-dd841810a592@googlegroups.com> <797da2f0-5f62-43b9-ab4d-c5eb8d6c64a2@googlegroups.com> In-Reply-To: <797da2f0-5f62-43b9-ab4d-c5eb8d6c64a2@googlegroups.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit 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: 45 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1375261163 news.xs4all.nl 15880 [2001:888:2000:d::a6]:33714 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:51633 Op 31-07-13 10:32, wxjmfauth@gmail.com schreef: > Unicode/utf* > ============ > > i) ("primary key") Create and use a unique set of encoded > code points. FSR does this. >>> st1 = 'a€' >>> st2 = 'aa' >>> ord(st1[0]) 97 >>> ord(st2[0]) 97 >>> > ii) ("secondary key") Depending of the wish, > memory/performance: utf-8/16/32 Whose wish? I don't know any language that allows the programmer choose the internal representation of its strings. If it is the designers choice FSR does this, if it is the programmers choice, I don't see why this is necessary for compliance. > Two advantages at the light of the above example: > iii) The "a" has never to be reencoded. FSR: check. Using a container with wider slots is not a reëncoding. If such widening is encoding then your 'choice' between utf-8/16/32 implies that it will also have to reencode when it changes from utf-8 to utf-16 or utf-32. > iv) An "a" size never exceeds 4 bytes. FSR: check. > Hard job to solve/satisfy i), ii), iii) and iv) at the same time. > Is is possible? ;-) The solution is in the problem. Mayby you should use bytes or bytearrays if that is really what you want. -- Antoon Pardon