Skip to content

Commit

Permalink
Avoid type warning when sorting dict keys by value
Browse files Browse the repository at this point in the history
  • Loading branch information
Gouvernathor committed May 2, 2024
1 parent b5952f4 commit e45ef01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parliamentarch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def write_svg_from_attribution(file: TextIOBase, attrib: dict[SeatData, int], **
raise TypeError("Unknown parameters : " + ", ".join(kwargs))

results = get_seats_centers(nseats, **get_seats_centers_kwargs)
seat_centers_by_group = dispatch_seats(attrib, sorted(results, key=results.get, reverse=True))
seat_centers_by_group = dispatch_seats(attrib, sorted(results, key=results.__getitem__, reverse=True))
write_grouped_svg(file, seat_centers_by_group, results.seat_actual_radius, **write_grouped_svg_kwargs)

get_svg_from_attribution = get_from_write(write_svg_from_attribution)

0 comments on commit e45ef01

Please sign in to comment.