Fredrik Lundh wrote: > 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) > I see you skip another use case of XMLRPC Duncan mentioned, is that a valid reason ?
-- http://mail.python.org/mailman/listinfo/python-list