Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed3.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; 'python,': 0.02; 'bits': 0.07; 'interpreted': 0.07; '-1.': 0.09; 'bit...': 0.09; 'bool': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'spelling': 0.09; 'python': 0.11; '>in': 0.16; '>on': 0.16; 'boolean': 0.16; 'message-id:@4ax.com': 0.16; 'operators,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'sorts': 0.16; 'suggested,': 0.16; 'wrote:': 0.16; 'comparing': 0.18; 'instance,': 0.18; 'odd': 0.18; 'subject:need': 0.18; 'url:home': 0.18; 'tests': 0.18; '>>>': 0.20; 'handling': 0.20; '(or': 0.21; 'do.': 0.22; 'meant': 0.22; 'subject:problem': 0.22; '2015': 0.23; "python's": 0.23; 'slightly': 0.23; 'signed': 0.24; 'header:X-Complaints-To:1': 0.26; 'chris': 0.26; '+0000': 0.27; 'possibility': 0.27; 'least': 0.27; 'said,': 0.27; 'comparison': 0.29; 'consequence': 0.29; 'convention': 0.31; 'fri,': 0.31; 'error.': 0.31; 'though,': 0.32; 'common': 0.33; 'true.': 0.33; 'languages': 0.34; 'to:addr:python-list': 0.35; 'next': 0.35; 'done': 0.35; 'false': 0.35; 'there': 0.36; 'subject:: ': 0.37; 'charset:us-ascii': 0.37; 'skip:z 10': 0.38; 'received:org': 0.38; 'pm,': 0.39; 'to:addr:python.org': 0.39; 'easily': 0.39; 'where': 0.40; 'some': 0.40; 'even': 0.61; 'simple': 0.61; 'today,': 0.62; 'safe': 0.63; 'different': 0.64; '(utc),': 0.84; '+1000,': 0.84; 'chrisa': 0.84; 'dennis': 0.91; 'received:108': 0.93; 'tricky': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: Logic problem: need better logic for desired thruth table. Date: Fri, 29 May 2015 08:48:59 -0400 Organization: IISS Elusive Unicorn References: <1432869619.871453.281061217.70B58077@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-108-79-216-129.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES 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: 32 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1432903758 news.xs4all.nl 2946 [2001:888:2000:d::a6]:46440 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:91452 On Fri, 29 May 2015 11:41:38 +0000 (UTC), alister declaimed the following: >On Fri, 29 May 2015 13:48:55 +1000, Chris Angelico wrote: > >> On Fri, May 29, 2015 at 1:20 PM, wrote: >>> The possibility of spelling these with the comparison operators, as >>> some have suggested, is a consequence of Python's implementation where >>> True == 1 and False == 0. In other languages bool may not be relatable >>> (or at least not orderable), or False may be == -1. >> >> True. That said, though, using 0 for False and 1 for True is easily the >> most common convention in use today, and the next most likely case is >> that comparing booleans would give a simple and immediate error. So it's >> most likely to be safe to do. Cross-language compatibility is a tricky >> thing anyway; there are all sorts of odd edge cases, even with >> otherwise-similar languages (Pike and Python, for instance, have >> slightly different handling of slice ranges), so anything that's done in >> Python is meant to be interpreted with Python semantics. >> >> ChrisA > >in the past True has even been -1 with 0 as false >(all bits set in a signed integer) And in VAX/VMS system return codes, odd numbers were "success/info" and even numbers "failure/warning" -- and VAX F77 did Boolean tests on just the least significant bit... So it wasn't even just a case of zero/non-zero. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/