specify a sorting key for sorting nested lists in ba module

sorting with objects that Python cannot compare
This commit is contained in:
Roman Trapeznikov 2020-04-10 12:37:45 +03:00
parent bb39357a70
commit b13df59274

View File

@ -189,7 +189,7 @@ class TeamGameResults:
sval.append(team)
results: List[Tuple[Optional[int],
List[ba.Team]]] = list(winners.items())
results.sort(reverse=not self._lower_is_better)
results.sort(reverse=not self._lower_is_better, key=lambda x: x[0])
# Also group the 'None' scores.
none_teams: List[ba.Team] = []