PEP 285: Adding a bool type

David Eppstein eppstein at ics.uci.edu
Sat Apr 6 21:32:21 EST 2002


In article <uavbgcabvl642b at news.supernews.com>,
 "John Roth" <johnroth at ameritech.net> wrote:

> Here I thought that teaching about bools was quite easy.
> Bools answer a specific question: is it x? True or False.
> They do not answer the question: which X is it?
> 
> In other words, bools select one possible case out of
> however many there are; they are not a substitute for a
> universe which has only two cases.

By the way, this is conceptually very similar to ints (at least, 
nonnegative ints): ints answer a specific question: how many things?  
They do not answer the question: which things are they.

Taken to the illogical extreme, Laura's position (that we should use 
ints instead of bools so we can always answer which x it is) would also 
mean that we should use lists instead of ints so we can always answer 
which things they are.

Specifically, in her favorite example of isLeapYear, if she thinks it 
should return a count of leap days instead of a bool, maybe it would be 
even more appropriate to return a list of leap days.

-- 
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