On 3/5/2010 1:54 PM, Jean-Michel Pichavant wrote:
Steven D'Aprano wrote:

Despite there are good reasons for bool to be int, the newcomer 'wtf'
reaction at first glance is legitimate.
Starting python from scratch, booleans would have not been a subclass of
int (just guessing though), 'cause it makes no sense from a design POV.

You are just guessing. I would argue for what we have. An example of its usefulness:

>>> scores =[True, False, True, True, False]
>>> score = sum(scores)
>>> score
3

Bools are also usefully used as sequence indexes.

Terry Jan Reedy



--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to