>Roy Smith wrote: >> def __cmp__ (self, other): >> # I wish there was a less verbose way to do this! >> if self.block < other.block: >> return -1 >> if self.block > other.block: >> return 1 >> if self.lot < other.lot: >> return -1 >> if self.lot > other.lot: >> return 1 >> return 0
Steven Bethard <[EMAIL PROTECTED]> wrote: >Does this do what you want? >... def __cmp__(self, other): >... return (cmp(self.block, other.block) or >... cmp(self.lot, other.lot)) Yes, that's exactly what I was after. Like so many things, it's obvious once it's pointed out to you. Thanks! -- http://mail.python.org/mailman/listinfo/python-list