Logic problem: need better logic for desired thruth table.

random832 at fastmail.us random832 at fastmail.us
Fri May 29 08:09:50 EDT 2015


On Thu, May 28, 2015, at 23:48, Chris Angelico wrote:
> On Fri, May 29, 2015 at 1:20 PM,  <random832 at 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.

Gah. I said "False may be -1", but what I *meant* was that *True* may be
-1: something that has some merit for bitwise logic (-1 is all-bits-1).
This is, for example, used in pre-.NET incarnations of Visual Basic (and
COM's VARIANT_BOOL type inherits from this). VB, incidentally, has its
own spellings for these operators, with the "Imp" and "Eqv" operators.



More information about the Python-list mailing list