y = {(100): 1, (90): 4, (99): 3, (92): 1, (101): 1}
reverse_comparison = lambda (a1, a2), (b1, b2): cmp((b2, b1), (a2, a1))
sorted(list(y.items()), cmp=reverse_comparison)
Sorting a dictionary by value then by key