mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-29 06:05:36 -08:00
Clean Code: Python
Fix issues found by flake8-bugbear: * Unused loop variables * assert statements in non-test code * mixing test code with production code * mark one excessive test which takes ~10min to run as 'slow'
This commit is contained in:
@@ -418,9 +418,9 @@ def find_board_index_that_matches_board(board):
|
||||
if matches:
|
||||
return board_index, is_reversed
|
||||
|
||||
# THE TERMINATION OF THIS LOOP IS IMPOSSIBLE
|
||||
print("ILLEGAL BOARD PATTERN.")
|
||||
assert False
|
||||
# This point should never be reached
|
||||
# In future, mypy might be able to check exhaustiveness via assert_never
|
||||
raise RuntimeError("ILLEGAL BOARD PATTERN.")
|
||||
|
||||
|
||||
def pick_computer_move(board):
|
||||
|
||||
Reference in New Issue
Block a user