Path: csiph.com!feeder.erje.net!2.eu.feeder.erje.net!newsfeed.kamp.net!newsfeed.kamp.net!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Operator Precedence/Boolean Logic Date: Sun, 17 Jul 2016 17:33:02 +1000 Lines: 41 Message-ID: References: <15997174-44d5-431c-8f90-a8d700921820@googlegroups.com> <576B9B33.2030903@rece.vub.ac.be> <07e13a5d-38bf-7bfa-f45f-a24dea8e3004@online.de> <576ba927$0$1504$c3e8da3$5496439d@news.astraweb.com> <87wplgfdb5.fsf@elektro.pacujo.net> <4c257ef7-519f-4121-b63b-fb38566072d0@googlegroups.com> <5773c832$0$1598$c3e8da3$5496439d@news.astraweb.com> <57745c6d$0$1583$c3e8da3$5496439d@news.astraweb.com> <5775555f$0$22140$c3e8da3$5496439d@news.astraweb.com> <7ecde6d0-d3db-4a7a-8de6-65b398fedafe@googlegroups.com> <578a0992$0$1610$c3e8da3$5496439d@news.astraweb.com> <578a605f$0$1611$c3e8da3$5496439d@news.astraweb.com> <0d294d49-2cf0-84be-ebcd-af1d0ffc7222@mrabarnett.plus.com> <9eda5007-a48f-4bac-8d09-c8af9e6b9987@googlegroups.com> <4854a8df-0d64-4abe-8289-ddad178d315f@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de MuBMGbdCewaSLVA/+czEJgrgs1I1QGM+gxIY3XeQuUSA== 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; 'true,': 0.04; 'think,': 0.05; 'defines': 0.07; 'false,': 0.07; 'false.': 0.07; 'null,': 0.07; 'semantic': 0.07; 'cc:addr:python-list': 0.09; 'collections': 0.09; 'python:': 0.09; '2016': 0.16; 'different,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'magic': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'machine': 0.21; '"",': 0.22; "aren't": 0.22; "python's": 0.23; 'header:In-Reply-To:1': 0.24; 'chris': 0.26; 'earlier': 0.27; 'points': 0.27; 'error': 0.27; 'message-id:@mail.gmail.com': 0.27; 'values': 0.28; 'cpu': 0.29; 'code:': 0.29; 'objects': 0.29; 'subject:/': 0.30; 'work.': 0.30; 'statement': 0.32; 'third': 0.33; 'flags': 0.33; 'jump': 0.33; 'received:google.com': 0.35; 'could': 0.35; 'false': 0.35; 'but': 0.36; 'there': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'two': 0.37; 'method': 0.37; 'say': 0.37; '(with': 0.38; 'anything': 0.38; 'sure': 0.39; 'save': 0.60; 'your': 0.60; 'statement,': 0.66; 'legal': 0.66; 'skip:\xe2 10': 0.70; 'jul': 0.72; 'truth': 0.79; '8bit%:16': 0.84; 'chrisa': 0.84; 'distinguish': 0.84; 'viable': 0.84; 'to:none': 0.91; '4:44': 0.91; 'notion': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:cc :content-transfer-encoding; bh=p9BFTiLKh0tPMRGClxpQw9F4iLyt850gpe2UzDuOaJM=; b=KLo4uflPTHFCDkOMqrjvqDOWbuoBS8WAhDFOjp46yCbmjEok+E2ZFYP7I0AqjnzEiE 5ruj6ppCn5eU0MQSbQsK1FhSAi7U+noewqxf85tNWJWuMb4cuhamlUI7mAwYGf23FBft QaeiUzgPG578oHYjwmUiELRedVSamwWDwoYMHrUN1p52DWnuRcPemXTU0CNNK74Pf6Z0 3WBkv8rn4UzpO3C287xk+S1A+dQ2/dqHb8Ferbnrt8yyqmNaVplKgA94DQ1dVo69Zb6b crY7pSPryjLfHs7TgZ8T1lGmulqV8ph1ryRvQgkppzRR6pUSw1sPL3xiR9tY3QfDamWt 6OYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc:content-transfer-encoding; bh=p9BFTiLKh0tPMRGClxpQw9F4iLyt850gpe2UzDuOaJM=; b=AbwCQ+cuRFK1CahtCeo9p886e9NrpD1+Iz2pqDkW/wHBCRY41dhowg/9tHaic4VF3H eKJf2Vu7JH68kcZuX2tSl6CXKiy4LiuTI5i1pjHYfCx4tMPvfEYMFjo8pFbsktdR/8E3 o6E/FaWZqx65gNjc1tsPUv4MAzjCf9sMZ9t92dxUayh6j5K8jGpGu22zzEgHr7TMZuFG 5vcHC8ExeHGOuADf7zFA9T742jjZNWs+Ib/mLvoLddxqQOwioHamINpM0EwEwegS91vT EoA17s2nK/w3bdXMJ/FU3rNK+iJPvnSQNKIDztWVtOeaPwHqaMrO9p9Ck9BsmmUi7XZT lPuA== X-Gm-Message-State: ALyK8tKCxkcmIqYZNMMdVANGLMudjfX4Wye/Etm3he5LKKPmyglvk6gqDvAED2QHlSlX2ZsOveXl6AP9WQHDxg== X-Received: by 10.28.50.199 with SMTP id y190mr41272615wmy.61.1468740783920; Sun, 17 Jul 2016 00:33:03 -0700 (PDT) In-Reply-To: <4854a8df-0d64-4abe-8289-ddad178d315f@googlegroups.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <15997174-44d5-431c-8f90-a8d700921820@googlegroups.com> <576B9B33.2030903@rece.vub.ac.be> <07e13a5d-38bf-7bfa-f45f-a24dea8e3004@online.de> <576ba927$0$1504$c3e8da3$5496439d@news.astraweb.com> <87wplgfdb5.fsf@elektro.pacujo.net> <4c257ef7-519f-4121-b63b-fb38566072d0@googlegroups.com> <5773c832$0$1598$c3e8da3$5496439d@news.astraweb.com> <57745c6d$0$1583$c3e8da3$5496439d@news.astraweb.com> <5775555f$0$22140$c3e8da3$5496439d@news.astraweb.com> <7ecde6d0-d3db-4a7a-8de6-65b398fedafe@googlegroups.com> <578a0992$0$1610$c3e8da3$5496439d@news.astraweb.com> <578a605f$0$1611$c3e8da3$5496439d@news.astraweb.com> <0d294d49-2cf0-84be-ebcd-af1d0ffc7222@mrabarnett.plus.com> <9eda5007-a48f-4bac-8d09-c8af9e6b9987@googlegroups.com> <4854a8df-0d64-4abe-8289-ddad178d315f@googlegroups.com> Xref: csiph.com comp.lang.python:111552 On Sun, Jul 17, 2016 at 4:44 PM, Rustom Mody wrote: > I am sure Chris you can distinguish between: > > - Python=E2=80=99s (bool) model is bizarre > - The model =E2=80=9CEverything has auto-bool-nature=E2=80=9D is bizarre > - The notion =C2=AB =E2=80=9CEverything has auto-bool-nature=E2=80=9D is = straightforward =C2=BB is bizarre > > > My earlier statement (with emphasis in original): >> You also have a bizarre notion that python's property: =E2=80=9CEverythi= ng has >> auto-bool-nature=E2=80=9D IS STRAIGHTFORWARD. I can distinguish them, yes. But Python's boolification model is fundamentally the same as the model "Everything has auto-bool-nature". So those two aren't really all that different, save that one of them is language-agnostic. I understand your third statement, but I posit that these last points have proven it false. There are clearly a number of viable semantic systems: 1) REXX and, I think, Pascal: there are two specific values that may be used in conditionals, and anything else is an error 2) Everything is legal in a conditional, and has a truth value 2a) Pike: 0 is false, every other object is true, unless it defines a magic method 2b) Python: Empty values and collections are false, everything else is true, unless it defines a magic method 2c) JavaScript: 0, null, undefined, nan, "", false are false, everything else is true, including all objects (no magic method option) 3) Machine code: There are no conditionals - just CPU flags that you can jump or not jump on. All of them work. So you could *disagree* with the statement that Python's model is straight-forward, but you cannot say that this statement is *bizarre*. ChrisA