bool behavior in Python 3000?

Paul Rubin http
Tue Jul 10 19:41:58 EDT 2007


Steven D'Aprano <steve at REMOVE.THIS.cybersource.com.au> writes:
> Pretending that False and True are just "magic names" for 0 and 1 might be
> "easier" than real boolean algebra, but that puts the cart before the
> horse. Functionality comes first: Python has lists and dicts and sets
> despite them not being ints, and somehow newcomers cope. I'm sure they
> will cope with False and True not being integers either.

Are they are aren't they?

print 1 in [True]
print 1 == True
print len(set(map(type, [1, 1])))
print len(set(map(type, [1, True])))



More information about the Python-list mailing list