Path: csiph.com!usenet.pasdenom.info!gegeweb.org!newsfeed.kamp.net!newsfeed.kamp.net!newsfeed.freenet.ag!news2.euro.net!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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'operator': 0.03; 'root': 0.04; 'bits': 0.07; 'subject:code': 0.07; 'python': 0.09; 'argument,': 0.09; 'cases': 0.15; '(and,': 0.16; 'chained': 0.16; 'evaluates': 0.16; 'parentheses': 0.16; 'received:192.168.1.50': 0.16; 'wrote:': 0.17; 'equivalent': 0.20; 'stick': 0.22; 'somebody': 0.23; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'am,': 0.27; 'rules': 0.27; 'actual': 0.28; 'arithmetic': 0.29; 'comparison': 0.29; "d'aprano": 0.29; 'steven': 0.29; "aren't": 0.33; 'to:addr:python-list': 0.33; "can't": 0.34; 'pm,': 0.35; 'but': 0.36; 'enough': 0.36; 'bad': 0.37; 'itself': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'first': 0.61; 'back': 0.62; 'received:62': 0.62; 'jul': 0.65; 'special': 0.73; 'from:addr:t': 0.84; 'received:62.75': 0.84 Date: Mon, 02 Jul 2012 16:41:49 +0200 From: Thomas Jollans User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: code review References: <4fed59b7$0$29978$c3e8da3$5496439d@news.astraweb.com> <2662370.TGmo96CKe1@PointedEars.de> <87wr2oecf6.fsf@dpt-info.u-strasbg.fr> <4FEF7117.7000109@jollybox.de> <4fefb0ad$0$29988$c3e8da3$5496439d@news.astraweb.com> <4fefcf72$0$29988$c3e8da3$5496439d@news.astraweb.com> <4fefedd8$0$29988$c3e8da3$5496439d@news.astraweb.com> <4ff0f939$0$29988$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: <4ff0f939$0$29988$c3e8da3$5496439d@news.astraweb.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1341240114 news.xs4all.nl 6844 [2001:888:2000:d::a6]:41813 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:24773 On 07/02/2012 03:28 AM, Steven D'Aprano wrote: > We *really did have* somebody arguing that chained comparisons are Bad > because you can't stick parentheses around bits of it without changing > the semantics. That was an actual argument, not a straw-man. Ahem. It may have been sub-optimally phrased in a way that opened itself up to attack, but I was arguing that Python comparisons operators are anomalous because they're not associative. (and, going back to the root of the argument, this makes them Bad because "Special cases aren't special enough to break the rules.") On Sun, 01 Jul 2012 21:50:29 -0400, Devin Jeanpierre wrote: > On Sun, Jul 1, 2012 at 9:28 PM, Steven D'Aprano > wrote: >> Technically, < in Python is left-associative: a < b < c first evaluates >> a, not b or c. But it is left-associative under the rules of comparison >> operator chaining, not arithmetic operator chaining. > > Left-associativity is when a < b < c is equivalent to (a < b) < c.