Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed6.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.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'sep': 0.09; '(string': 0.16; 'benjamin': 0.16; 'hits': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'remembered': 0.16; 'wed,': 0.16; 'string': 0.17; 'wrote:': 0.17; 'earlier': 0.21; 'header:In- Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'common': 0.26; 'am,': 0.27; 'possibly': 0.27; 'header:X-Complaints-To:1': 0.28; "d'aprano": 0.29; 'equality': 0.29; 'steven': 0.29; 'cases,': 0.33; 'mixed': 0.33; 'to:addr:python-list': 0.33; 'entry': 0.33; "can't": 0.34; 'list': 0.35; 'subject:?': 0.35; 'something': 0.35; 'received:org': 0.36; 'but': 0.36; 'compare': 0.36; 'subject:: ': 0.38; 'daily': 0.38; 'science': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'think': 0.40; 'most': 0.61; 'else.': 0.65; 'forward': 0.66; 'oscar': 0.84; 'average': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Gelonida N Subject: Re: Comparing strings from the back? Date: Sat, 08 Sep 2012 17:50:22 +0200 References: <504564ba$0$29978$c3e8da3$5496439d@news.astraweb.com> <504761ef$0$29981$c3e8da3$5496439d@news.astraweb.com> <50477cbb$0$29981$c3e8da3$5496439d@news.astraweb.com> <50485fca$0$29977$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: unicorn.dungeon.de User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0 In-Reply-To: <50485fca$0$29977$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: 1347119434 news.xs4all.nl 6872 [2001:888:2000:d::a6]:45662 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:28727 On 09/06/2012 10:33 AM, Steven D'Aprano wrote: > On Wed, 05 Sep 2012 22:47:14 +0000, Oscar Benjamin wrote: > > I may have been overly-conservative earlier when I said that on average > string equality has to compare half the characters. I thought I had > remembered that from a computer science textbook, but I can't find that > reference now, so possibly I was thinking of something else. (String > searching perhaps?). Yeah I think you mixed it up with searching an entry in an unsorted list of length N That's one of the most common N/2 cases, that one hits daily with many straight forward implementations