Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; '"c"': 0.07; 'interpreted': 0.07; 'subject:code': 0.07; 'notation': 0.09; 'wrong,': 0.09; 'language': 0.14; '"x"': 0.16; '"x")': 0.16; 'chained': 0.16; 'evaluates': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'programmer,': 0.16; 'simple.': 0.16; 'mon,': 0.16; 'wrote:': 0.17; '(or': 0.18; 'received:209.85.214.174': 0.21; 'header:In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; "d'aprano": 0.29; 'steven': 0.29; 'manual': 0.29; 'this.': 0.29; "i'm": 0.29; 'to:addr:python- list': 0.33; 'languages': 0.33; 'that,': 0.34; 'received:google.com': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'explain': 0.36; 'but': 0.36; 'test': 0.36; 'enough': 0.36; 'quite': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'sure': 0.38; 'to:addr:python.org': 0.39; 'received:209.85.214': 0.39; 'header:Received:5': 0.40; 'jul': 0.65; 'obvious': 0.71; '6:11': 0.84; 'differently:': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=FkEW6VDcZ6T4TUyJWlWOUWPLlB40fjCdr5gFNeCr3Vk=; b=DfXJ9J9VwrF0pC/0SwLJtHRQrTLxM90rta0XY9M7kGKofIDee6kaJ7TyeZgq99qXqU fo27/RB51m2xowe6fSLATTDBgNfxmO3T5vzL+5ijFKsWQYWtgxUR6B9KtDVzvqY/s2WJ SGEsKJzdinaCvjvvU/kZsoaTiqUscCns4inc+1wzm6Td9CZibsEO/aQ1w8npO43D18se Gs2ANE3Yb07maYWFnZAc33627Y877RZWIgznLTRiJ4zG84D2aEM0oEanaLgh9QkmjLpv exVF/dO0kX51EfXS6krio0u/afkVsWqIdiIozvM8TIXwN08ouL1mha2PvAFZdvCkfSmr PnsA== MIME-Version: 1.0 In-Reply-To: <4ff157a4$0$30001$c3e8da3$5496439d@news.astraweb.com> References: <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> <4ff157a4$0$30001$c3e8da3$5496439d@news.astraweb.com> Date: Mon, 2 Jul 2012 18:20:57 +1000 Subject: Re: code review From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1341217261 news.xs4all.nl 6905 [2001:888:2000:d::a6]:43933 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:24769 On Mon, Jul 2, 2012 at 6:11 PM, Steven D'Aprano wrote: > "c" < first_word < second_word == third_word < "x" > > I'm sure I don't have to explain what that means -- that standard chained > notation for comparisons is obvious and simple. > > In Python, you write it the normal way, as above. But some other > languages force you into verbosity: > > ("c" < first_word) and (first_word < second_word) and (second_word == > third_word) and (third_word < "x") Uhh, actually you DO have to explain that, because I interpreted it quite differently: (("c" < first_word) and (first_word < second_word)) == (third_word < "x") And even if you can prove that my interpretation is wrong, it's still plausible enough that I, as a programmer, would have to dive to the manual (or test in interactive interpreter) to find out which way the language evaluates this. ChrisA