summaryrefslogtreecommitdiffstats
path: root/4.py
diff options
context:
space:
mode:
Diffstat (limited to '4.py')
-rw-r--r--4.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/4.py b/4.py
index dfd7468..04f645f 100644
--- a/4.py
+++ b/4.py
@@ -1,6 +1,8 @@
+# pyright: strict
from dataclasses import dataclass
from functools import cache
from sys import stdin
+from typing import Type
@dataclass(frozen=True)
@@ -14,7 +16,7 @@ class Card:
return len(self.winning & self.have)
@classmethod
- def from_str(cls, s: str):
+ def from_str[T](cls: Type[T], s: str) -> T:
card, rest = s.split(": ")
_, card_id = card.split()
winning, have = rest.split(" | ")