I just noticed a significant change to the definition of the sort method on
lists.  I've found the cmp function argument to sort very useful on occasion,
so I'm astonished to learn it's been dropped in Python 3.  I can appreciate
the utility of the key function (when it can be expressed), but sometimes
it's impractical to assign each list element a stand-alone numerical value
to be use for the built-in comparison.

It's possible I've got it wrong. Can someone show me how to sort a list
of tuples where two elements are numbers over an unknown range and the
cmp function would be:
        def cmp(A,B):
          if A[0] < B[0]:
            return -1
          elif A[0] > B[0]:
            return 1
          elif A[1] < B[1]:
            return -1
          elif A[1] > B[1]:
            return 1
          else:
            return 0

-- 
Randolph Bentson
[email protected]

Reply via email to