return cmp(self.state,

        return cmp(self.state, other.state,) or 
                cmp(self.last,other.last) or 
                cmp(self.first,other.first)
could be written as
        return cmp((self.state, self.last, self.first), 
                 (other.state, other.last, other.first))
without relying on "or trickery".

Reply

The content of this field is kept private and will not be shown publicly.