cmp(x, y) 函数在 python3.x 中不可用,可用以下函数替代:
operator.lt(a, b) lt(a, b)相当于 a < b
operator.le(a, b) le(a,b)相当于 a <= b
operator.eq(a, b) eq(a,b)相当于 a == b
operator.ne(a, b) ne(a,b)相当于 a != b
operator.ge(a, b) gt(a,b)相当于 a >= b
operator.gt(a, b) ge(a, b)相当于 a > b