Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #91424
| References | <1432869619.871453.281061217.70B58077@webmail.messagingengine.com> |
|---|---|
| Date | 2015-05-29 13:48 +1000 |
| Subject | Re: Logic problem: need better logic for desired thruth table. |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.154.1432871339.5151.python-list@python.org> (permalink) |
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 | Next — Next in thread | Find similar | Unroll 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