PEP 285: Adding a bool type

David Eppstein eppstein at ics.uci.edu
Mon Apr 1 22:21:16 EST 2002


In article <a8b4kk$je2$0 at 216.39.172.122>, bokr at oz.net (Bengt Richter) 
wrote:

> >If you called it "binary" instead of "bool" would it help you think of 
> >it as being more like a number?
> >
> No. Because numbers are ordered, and bools are not. bools are selected
> elements from an unordered set of two possibilities. The bool is one chosen
> element, but the element can be anything that can be distinguished from the
> other element of the set. They have names str(b) associated with them, but
> they don't have an order. One is chosen to mean logical true and the other
> logical false, but they are just tokens with no necessary order.

But there are systems of numbers that are just as much "selected 
elements from an unordered set" as the boolean truth values: the members 
of the various finite fields.  In fact the field of order two is a 
pretty good match for the booleans.

-- 
David Eppstein       UC Irvine Dept. of Information & Computer Science
eppstein at ics.uci.edu http://www.ics.uci.edu/~eppstein/



More information about the Python-list mailing list