From 1b70f3065663023b5a76c64b2b460a9231c64ecd Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sun, 12 Dec 2021 06:59:53 +0100 Subject: Fix defaultdict typehints --- 2021/12/puzzles.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '2021/12') diff --git a/2021/12/puzzles.py b/2021/12/puzzles.py index 2194c49..a395f5c 100644 --- a/2021/12/puzzles.py +++ b/2021/12/puzzles.py @@ -3,7 +3,7 @@ from collections import defaultdict -def solve(paths: defaultdict[list[str]], path: str, flag: bool = False) -> int: +def solve(paths: defaultdict[str, list[str]], path: str, flag: bool = False) -> int: acc = 0 tokens = path.split(",") @@ -27,7 +27,7 @@ def solve(paths: defaultdict[list[str]], path: str, flag: bool = False) -> int: def main() -> None: - paths: defaultdict[list[str]] = defaultdict(list) + paths: defaultdict[str, list[str]] = defaultdict(list) with open("input", "r", encoding="utf-8") as f: for entry in f.readlines(): x, y = entry.strip().split("-") -- cgit v1.2.3