From c69fa9a7939e1b4fb0bd856bf910b306339ed781 Mon Sep 17 00:00:00 2001 From: Alex Stokes Date: Sun, 6 Jan 2019 17:41:11 -0600 Subject: [PATCH] Fixes typo in `sorted` function. In keeping with the rest of the code in this document we adhere to valid Python where possible. The custom comparator keyword argument for `sorted` is `key` so this commit updates its usage when sorting validators by exit order. --- specs/core/0_beacon-chain.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index e4042c95d..f96dec900 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -1729,7 +1729,7 @@ def process_penalties_and_exits(state: BeaconState) -> None: all_indices = list(range(len(state.validator_registry))) eligible_indices = filter(eligible, all_indices) - sorted_indices = sorted(eligible_indices, filter=lambda index: state.validator_registry[index].exit_count) + sorted_indices = sorted(eligible_indices, key=lambda index: state.validator_registry[index].exit_count) withdrawn_so_far = 0 for index in sorted_indices: validator = state.validator_registry[index]