From 2b7dbf48d07b3ed9f945f1ad15e2ea2683beceba Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Sun, 5 Nov 2023 16:07:31 +0100 Subject: Fix MyFiniteSetDisjointUnion --- src/act4e_solutions/sets_sum.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/act4e_solutions/sets_sum.py b/src/act4e_solutions/sets_sum.py index f36cec1..19f1969 100644 --- a/src/act4e_solutions/sets_sum.py +++ b/src/act4e_solutions/sets_sum.py @@ -4,7 +4,7 @@ import act4e_interfaces as I X = TypeVar("X") C = TypeVar("C") -E = Tuple[int, C] +E = List # Tuple[int, C] class MyFiniteSetDisjointUnion(I.FiniteSetDisjointUnion[C, E]): _components: List[I.FiniteSet[C]] @@ -28,7 +28,7 @@ class MyFiniteSetDisjointUnion(I.FiniteSetDisjointUnion[C, E]): es = [] for i, c in enumerate(self._components): for e in c.elements(): - es.append((i, e)) + es.append([i, e]) return es @@ -42,7 +42,7 @@ class MyFiniteSetDisjointUnion(I.FiniteSetDisjointUnion[C, E]): if not self._components[i].contains(e): raise I.InvalidValue - return (i, e) + return [i, e] def unpack(self, e: E) -> Tuple[int, C]: return tuple(e) -- cgit v1.2.1