Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!eweka.nl!hq-usenetpeers.eweka.nl!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed5.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.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'operator': 0.03; 'developer,': 0.05; 'prefix': 0.07; 'suffix': 0.07; 'forms,': 0.09; 'cc:addr:python-list': 0.10; ';-)': 0.11; 'cases': 0.15; 'determining': 0.16; 'equality.': 0.16; 'lisp': 0.16; 'to:addr:pearwood.info': 0.16; 'to:addr:steve+comp.lang.python': 0.16; "to:name:steven d'aprano": 0.16; 'wrote:': 0.17; 'discussion': 0.20; 'forms.': 0.22; 'cc:2**0': 0.23; 'somebody': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'library.': 0.27; 'propose': 0.27; 'received:24': 0.27; "d'aprano": 0.29; 'dan': 0.29; 'equality': 0.29; 'steven': 0.29; 'belong': 0.33; 'likely': 0.33; 'agree': 0.34; 'third': 0.34; 'decisions': 0.35; 'said,': 0.35; 'subject:?': 0.35; 'similar': 0.35; 'there': 0.35; 'really': 0.36; 'but': 0.36; 'wanted': 0.36; 'charset:us-ascii': 0.36; 'rather': 0.37; 'subject:: ': 0.38; 'several': 0.39; 'application': 0.40; 'where': 0.40; 'content- disposition:inline': 0.60; 'different': 0.63; 'levels': 0.66; 'middle': 0.66; '"yes,': 0.84; 'fourth': 0.84; 'spawned': 0.84; 'besides,': 0.93; 'imagine': 0.96 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=tombstonezero.net; h=date:from:to:cc:subject:message-id:references:mime-version:content-type:in-reply-to; s=key1; bh=W8y40vmrVB4VQDqhIwaaJxpNIVM=; b=kE5g6pHJNzJs2/wIga1Hy3Oew+Cqq0SqjXrqnu+QOQBAR5nB8XUTiMefH+jGBfdbqznzolk4ugFiPr1SWdEzTA== DomainKey-Signature: a=rsa-sha1; c=nofws; d=tombstonezero.net; q=dns; s=key1; b=TLp7maXoUdtnho7hrNowtxGJIFVGwZTyC52VWvzTB9Md7BOUoXcMtBj6GjUssHlp+4dn+uKBKASSQCMXMQcrdA== X-Virus-Scanned: Debian amavisd-new at 5013.mail.vm.your-site.com Date: Mon, 3 Sep 2012 21:56:51 -0700 From: Dan Sommers To: Steven D'Aprano Subject: Re: Comparing strings from the back? References: <504564ba$0$29978$c3e8da3$5496439d@news.astraweb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <504564ba$0$29978$c3e8da3$5496439d@news.astraweb.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: python-list@python.org 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: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1346735738 news.xs4all.nl 6937 [2001:888:2000:d::a6]:42374 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:28389 On 2012-09-04 at 02:17:30 +0000, Steven D'Aprano wrote: > Besides, then somebody will say "Yes, but what about the cases where > the prefix and the suffix are both equal, but the middle will be > different?" and propose a third string-equality operator ==== and > then there will be bloodshed. Lisp has several equality forms, although they're for different kinds or levels of equality rather than for different algorithms for determining that equality. I imagine that a discussion similar to this one spawned many of those forms. I agree with Steven: decisions such as this belong to the application developer, not the standard library. Don't forget the fourth string-equality operator for case-insensitive comparisons and the fifth string-equality operator for strings that are likely to be palindromes. That said, if I really wanted bloodshed, I would propose = for the third string-equality operator! ;-) Dan