integer >= 1 == True and integer.0 == False is bad, bad, bad!!!

Michael Torrie torriem at gmail.com
Tue Jul 13 01:28:26 EDT 2010


On 07/12/2010 06:18 PM, Steven D'Aprano wrote:
> Early versions of BASIC used -1 as true and 0 as false.

They did this for good reason.  BASIC had no logical operators.  AND,
OR, and NOT were all actually bitwise operators.  By making the True
value -1, the bitwise operations yielded the result one would expect
from logical operations.



More information about the Python-list mailing list