Skip to content

Commit

Permalink
Removed an instance of Any within gaming.py
Browse files Browse the repository at this point in the history
  • Loading branch information
49Indium committed Jul 2, 2023
1 parent d5eff13 commit 56aade6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions uqcsbot/gaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,19 @@ def get_bgg_id(self, search_name: str) -> Optional[str]:
return None

# filters for the closest name match
match: Any = {}
match: Dict[str, float] = {}
for item in results:
if item.get("id") is None:
item_id = item.get("id")
if item_id is None:
continue
for element in item:
if element.tag == "name":
match[item.get("id")] = SequenceMatcher(
match[item_id] = SequenceMatcher(
None,
search_name,
(x if (x := element.get("value")) is not None else ""),
).ratio()
return max(match, key=match.get)
return max(match, key=lambda x: match.get(x, 0))

def get_board_game_parameters(self, identity: str) -> Optional[Parameters]:
"""
Expand Down

0 comments on commit 56aade6

Please sign in to comment.