def team_cmp(t1, t2):
    for key_func, reverse in [(Team.getName, True), (Team.getGoalDifference,
        True), (Team.getPoints, True)]:
        result = cmp(key_func(t1), key_func(t2))
if reverse:
    result = -result
if result:
    return result
return 0
table.sort(functools.cmp_to_key(team_cmp))
Сортировка по нескольким условиям в python