mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-03-25 23:43:26 -07:00
add return type to weighted random
This commit is contained in:
@@ -215,7 +215,7 @@ def parse_game_ports(game_ports: tuple[str | int]) -> GameRangePorts:
|
||||
return GameRangePorts(parsed_ports, weights, ephemeral_allowed)
|
||||
|
||||
|
||||
def weighted_random(ranges: list[range], cum_weights: list[int]):
|
||||
def weighted_random(ranges: list[range], cum_weights: list[int]) -> int:
|
||||
[picked] = random.choices(ranges, cum_weights=cum_weights)
|
||||
return random.randrange(picked.start, picked.stop, picked.step)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user