Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed7.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.018 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'subject: + ': 0.07; 'cc:addr:python-list': 0.09; 'precedence': 0.09; 'subject:not': 0.11; "'+'": 0.16; '1))': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'table;': 0.16; 'wrote:': 0.16; '(not': 0.20; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'sat,': 0.23; 'header:In-Reply-To:1': 0.24; 'message- id:@mail.gmail.com': 0.27; 'arithmetic': 0.29; 'url:python': 0.33; 'gets': 0.35; 'received:google.com': 0.35; 'false': 0.35; 'url:org': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'expect': 0.37; 'jul': 0.72; "'not'": 0.84; 'chrisa': 0.84; 'to:none': 0.91; 'url:reference': 0.91 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:cc :content-type; bh=1xBBRHPpDE+C0vauzYyw0VHYMmEHp4dVpQSJPNj/kwk=; b=iC29jx66Zz5pvKwB/faAljwZsfxTUdN/GCddtZnjuNfdICxHIUfH2J8ZUNl0079ADx gMbGc3d22/r4VZbDkcuFWMzbtjBGSg8PxvR1uDknOvJvz8chRSXQ9j1BZJC5Aut+79VQ goNFSaGwHfj+JOjS0mLPiFL/UG/6Ewj0qqTZIcUiN3uli4/18oblZOXNQgaPptr6nbHC RSfYs20iqpS4Rh1kEQxBnjH7K1xD4rqcTHscjzbSv90c+aefcQgYOM/ytt8f7DG7Y3jL 9bWCp9omEiQojl1LixncXn1M+JIEQUU5YokQgqxac8AjIEMT4IJ3YbolvT5mgyV36TPx KyOQ== MIME-Version: 1.0 X-Received: by 10.50.122.65 with SMTP id lq1mr3339069igb.56.1436613613763; Sat, 11 Jul 2015 04:20:13 -0700 (PDT) In-Reply-To: <55a0fa36$0$2935$e4fe514c@news.xs4all.nl> References: <01ec6551-1f40-42b0-9406-036030591519@googlegroups.com> <55a0f241$0$2933$e4fe514c@news2.news.xs4all.nl> <55a0fa36$0$2935$e4fe514c@news.xs4all.nl> Date: Sat, 11 Jul 2015 21:20:13 +1000 Subject: Re: 0 + not 0 From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 1436613616 news.xs4all.nl 2967 [2001:888:2000:d::a6]:51769 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:93676 On Sat, Jul 11, 2015 at 9:12 PM, Luuk wrote: > It can occur in an arithmetic expression, and 'not' has a higher precedence > than '+' > (https://docs.python.org/2/reference/expressions.html#operator-precedence) > I think you're misreading the table; 'not' has *lower* precedence than '+'. > But, it gets confusing...... >>>> not 0 + 1 > False >>>> not 0 > True >>>> True + 1 > 2 >>>> > > i would expect 'not 0 + 1' to return the same value as 'True + 1' (not 0 + 1) == (not (0 + 1)) ChrisA