PEP 285: Adding a bool type

David Eppstein eppstein at ics.uci.edu
Mon Apr 1 18:58:32 EST 2002


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

> Well, for types that are related in certain ways ... ;-)
> 
>  >>> 0 == 0.0
>  1
>  >>> 1 == 1.0
>  1
>  >>> 1 == 2.0
>  0
> 
> That gets into what relational operators really should mean.
> I think I exclude bool from the number tree, so I don't
> like the effect of subtyping bool from int, even though
> I support context-dependent implicit conversions to integer
> (though that context should be defined by the client expression ops).

If you called it "binary" instead of "bool" would it help you think of 
it as being more like a number?

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