From fb45c9440d4690bd63ff421d867d096b322a1b55 Mon Sep 17 00:00:00 2001 From: Stefan Harmuth Date: Sat, 14 Dec 2024 09:09:38 +0100 Subject: [PATCH] day14 - cleanup typing annotations --- day14.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/day14.py b/day14.py index 8f6c689..5c2fd03 100644 --- a/day14.py +++ b/day14.py @@ -3,6 +3,9 @@ from tools.tools import compare from typing import Any +type Robot = tuple[tuple[int, int], tuple[int, int]] + + class Day(AOCDay): inputs = [ [ @@ -14,7 +17,7 @@ class Day(AOCDay): ], ] - def parse_input(self) -> list[tuple[tuple[int, int], tuple[int, int]]]: + def parse_input(self) -> list[Robot]: robots = [] for line in self.getInput(): p, v = line.split() @@ -24,9 +27,7 @@ class Day(AOCDay): return robots - def move_robots( - self, robots: list[tuple[tuple[int, int], tuple[int, int]]], steps: int = 100 - ) -> tuple[tuple[int, int], list[tuple[tuple[int, int], tuple[int, int]]]]: + def move_robots(self, robots: list[Robot], steps: int = 100) -> tuple[tuple[int, int], list[Robot]]: if self.is_test(): dim = (11, 7) else: