From 9c00dd61a4648124be5e61fede21fe1856c31156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Sun, 20 Aug 2023 11:46:36 +0000 Subject: [PATCH] remove Board.__len__() --- pigeon_magnet_solver/board.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pigeon_magnet_solver/board.py b/pigeon_magnet_solver/board.py index 355037e..649c58a 100644 --- a/pigeon_magnet_solver/board.py +++ b/pigeon_magnet_solver/board.py @@ -28,9 +28,6 @@ class Board: else: return len(self.rows[0]) - def __len__(self) -> int: - return self.height * self.width - def __post_init__(self) -> None: # check char set chars = {c for c in "".join(self.rows)} @@ -44,7 +41,7 @@ class Board: # check buttons assert all( - button in range(len(self)) + button in range(self.height * self.width) for button in self.buttons ), "Invalid buttons!"