Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #91424

Re: Logic problem: need better logic for desired thruth table.

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeder1.news.weretis.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
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; 'interpreted': 0.07; '-1.': 0.09; 'bool': 0.09; 'spelling': 0.09; 'cc:addr:python-list': 0.10; 'python': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'operators,': 0.16; 'sorts': 0.16; 'suggested,': 0.16; 'wrote:': 0.16; 'comparing': 0.18; 'instance,': 0.18; 'odd': 0.18; 'subject:need': 0.18; 'handling': 0.20; '(or': 0.21; 'cc:2**0': 0.21; 'cc:addr:python.org': 0.21; 'do.': 0.22; 'meant': 0.22; 'subject:problem': 0.22; '2015': 0.23; "python's": 0.23; 'slightly': 0.23; 'header:In-Reply-To:1': 0.24; 'possibility': 0.27; 'least': 0.27; 'said,': 0.27; 'message-id:@mail.gmail.com': 0.28; '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; 'received:google.com': 0.34; 'next': 0.35; 'done': 0.35; 'false': 0.35; 'there': 0.36; 'subject:: ': 0.37; 'pm,': 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; 'chrisa': 0.84; 'to:none': 0.90; 'tricky': 0.93
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=hHblqdQQf8EarHgBNFwacWbG2a+6dh/+yLj9Zrgk91c=; b=rj4rP7+02sUjomMQIDuSaOxnYRoEXJYXXX6NfJk3kFHIVjykhR811s864WL8K7vtLr UWijpOgPMZKoiPUmOF0juIUGw3CQ2ygPu45E3Oy+OB0t9xVzAzOJlN+0YqncyalXvkVd 10pro4eutgx/pJthbOPIp8/uaN4DhKUROEtNmQTQ+MJR9xBcrPQq2zNFc9y3og+Xls5g c76aghL2SnTerAhBiuirtNCjpTEzIugTsi579C/B0Qo4HHL/fnX49AbSkrqIh4eXHQQz LoNO8ZCdCLn7pCmdqRn9ACUiorkBZk2ysAsoUy64I9i6Pz3q6kglCMSLptJkv8fW/p0V vHZw==
MIME-Version 1.0
X-Received by 10.43.39.1 with SMTP id tk1mr12819225icb.26.1432871336358; Thu, 28 May 2015 20:48:56 -0700 (PDT)
In-Reply-To <1432869619.871453.281061217.70B58077@webmail.messagingengine.com>
References <1432869619.871453.281061217.70B58077@webmail.messagingengine.com>
Date Fri, 29 May 2015 13:48:55 +1000
Subject Re: Logic problem: need better logic for desired thruth table.
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <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 <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.154.1432871339.5151.python-list@python.org> (permalink)
Lines 16
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1432871339 news.xs4all.nl 2826 [2001:888:2000:d::a6]:49130
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:91424

Show key headers only | View raw


On Fri, May 29, 2015 at 1:20 PM,  <random832@fastmail.us> 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

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: Logic problem: need better logic for desired thruth table. Chris Angelico <rosuav@gmail.com> - 2015-05-29 13:48 +1000
  Re: Logic problem: need better logic for desired thruth table. alister <alister.nospam.ware@ntlworld.com> - 2015-05-29 11:41 +0000
    Re: Logic problem: need better logic for desired thruth table. Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-05-29 08:48 -0400

csiph-web