Duncan Booth wrote: > Another reason to have a boolean type is of course to provide a cast: > > def isNameSet(self): > return boolean(self.name) > > instead of: > > def isNameSet(self): > if self.name: > return True > else: > return False
given that Python already had a function for this, that wasn't much of a reason: >>> help(operator.truth) Help on built-in function truth in module operator: truth(...) truth(a) -- Return True if a is true, False otherwise. (truth returned 1 or 0 in pre-boolean versions) (btw, instead of speculating about the rationale, why don't you all go and read Guido's PEP ?) </F> -- http://mail.python.org/mailman/listinfo/python-list