Вот идиома, которая работает для всего, даже для вещей, которые нельзя отрицать, например, для строк:
data = [ ('a', 'a'), ('a', 'b'), ('b','a') ]
def sort_func( a, b ):
# compare tuples with the 2nd entry switched
# this inverts the sorting on the 2nd entry
return cmp( (a[0], b[1]), (b[0], a[1]) )
print sorted( data ) # [('a', 'a'), ('a', 'b'), ('b', 'a')]
print sorted( data, cmp=sort_func ) # [('a', 'b'), ('a', 'a'), ('b', 'a')]