Skip to content

Commit

Permalink
Clean up type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
eoinnoble committed May 12, 2021
1 parent 9fbf2ea commit 238ea92
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions server/games/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging
import time
from collections import defaultdict
from typing import Any, Dict, FrozenSet, Iterable, List, Optional, Set, Tuple
from typing import Any, Dict, FrozenSet, Iterable, List, Optional, OrderedDict, Set, Tuple

import pymysql
from sqlalchemy import and_, bindparam
Expand Down Expand Up @@ -841,7 +841,7 @@ def get_player_outcome(self, player: Player) -> ArmyOutcome:

return self._results.outcome(army)

def get_army_results(self, player: Player) -> ArmyResult:
def get_army_results(self, player: Player) -> OrderedDict:
army = self.get_player_option(player.id, "Army")
return ArmyResult(
player.id,
Expand Down
8 changes: 4 additions & 4 deletions server/games/typedefs.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from enum import Enum, unique
from typing import Any, Dict, List, NamedTuple, Optional, Set
from typing import Any, Dict, List, NamedTuple, Optional, OrderedDict, Set

from server.games.game_results import ArmyResult, GameOutcome
from server.games.game_results import GameOutcome
from server.players import Player


Expand Down Expand Up @@ -123,7 +123,7 @@ class BasicGameInfo(NamedTuple):
class TeamRatingSummary(NamedTuple):
outcome: GameOutcome
player_ids: Set[int]
army_results: List[ArmyResult]
army_results: List[OrderedDict]


class EndedGameInfo(NamedTuple):
Expand Down Expand Up @@ -155,7 +155,7 @@ def from_basic(
validity: ValidityState,
team_outcomes: List[GameOutcome],
commander_kills: Dict[str, int],
team_army_results: List[List[Dict]],
team_army_results: List[List[OrderedDict]],
) -> "EndedGameInfo":
if len(basic_info.teams) != len(team_outcomes):
raise ValueError(
Expand Down

0 comments on commit 238ea92

Please sign in to comment.