bool behavior in Python 3000?

Steven D'Aprano steve at REMOVE.THIS.cybersource.com.au
Wed Jul 11 22:24:21 EDT 2007


On Wed, 11 Jul 2007 00:37:38 -0700, Rob Wolfe wrote:

> 
> Steven D'Aprano wrote:
> 
>> From a purely functional perspective, bools are unnecessary in Python. I
>> think of True and False as syntactic sugar. But they shouldn't be
>> syntactic sugar for 1 and 0 any more than they should be syntactic sugar
>> for {"x": "foo"} and {}.
> 
> But `bools` are usefull in some contexts. 


Agreed. Syntactic sugar is useful, even though it is unnecessary. I'm not
against having bools. I just want them to be Booleans, not dicts, or
lists, or sets, or even integers.



-- 
Steven.




More information about the Python-list mailing list