Quoted from the docs:
Compare the two objects x and y and return an integer according to the outcome. The return value is negative if, zero if
x < yand strictly positive if
x == y.
x > y
No, the docs explicitly say that yalues can be anything. The only value that is specified is
0 if the compared objects are equal. Don't trust the fact that you only see the values
1, that's an implementation detail and could change*, so always check for
*: note - actually, it won't really have a chance to change, since
cmp has gone away in pyhton3. use rich comparison instead.