Implement __cmp__.