Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'mathematics': 0.04; 'subject:code': 0.07; 'used.': 0.07; 'python': 0.09; 'consistency.': 0.09; 'notation': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'terry': 0.09; 'language': 0.14; 'chained': 0.16; 'comparisons,': 0.16; 'message-id:@dough.gmane.org': 0.16; 'operators,': 0.16; 'operators.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'wrote:': 0.17; 'jan': 0.18; 'appropriate': 0.20; 'programming': 0.23; 'feature': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'am,': 0.27; 'header:X-Complaints-To:1': 0.28; 'arithmetic': 0.29; 'behaviour': 0.29; 'comparison': 0.29; 'consistency': 0.29; "d'aprano": 0.29; 'steven': 0.29; 'no,': 0.29; 'included': 0.29; 'that.': 0.30; "aren't": 0.33; 'to:addr :python-list': 0.33; 'languages': 0.33; 'sequence': 0.35; 'received:org': 0.36; 'subject:: ': 0.38; 'gives': 0.39; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'first': 0.61; 'great': 0.64; 'learned': 0.65; 'treat': 0.65; 'special': 0.73; 'received:fios.verizon.net': 0.84; 'treats': 0.84; 'favour': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: code review Date: Sun, 01 Jul 2012 05:55:24 -0400 References: <6c39594f-79cb-4d4f-967e-bbc3f68cdbdf@f8g2000pbf.googlegroups.com> <4fed59b7$0$29978$c3e8da3$5496439d@news.astraweb.com> <2662370.TGmo96CKe1@PointedEars.de> <87wr2oecf6.fsf@dpt-info.u-strasbg.fr> <4FEF7117.7000109@jollybox.de> <87bok0qr62.fsf@benfinney.id.au> <4fefc2a8$0$29988$c3e8da3$5496439d@news.astraweb.com> <4feff408$0$29965$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-74-109-121-73.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 In-Reply-To: <4feff408$0$29965$c3e8da3$5496439d@news.astraweb.com> 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: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1341136538 news.xs4all.nl 6898 [2001:888:2000:d::a6]:38207 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:24739 On 7/1/2012 2:54 AM, Steven D'Aprano wrote: > So no, Python has always included chained comparisons, and yes, it is > shameful that a language would force you to unlearn standard notation in > favour of a foolish consistency with other operators. Comparisons aren't > special because they return bools. They are special because of the way > they are used. > > C treats comparison operators as if they were arithmetic operators, and > so the behaviour of a chained comparison is the same as the behaviour as > a sequence of arithmetic operators: a foolish consistency. Python treats > comparison operators as comparison operators, and gives them behaviour > appropriate to comparisons. I considered this a great feature of Python when I first learned it. Reading about how rare it is among programming languages to treat comparisons in the standard way in mathematics reinforces that. -- Terry Jan Reedy