summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNao Pross <np@0hm.ch>2023-11-05 16:07:31 +0100
committerNao Pross <np@0hm.ch>2023-11-05 16:07:31 +0100
commit2b7dbf48d07b3ed9f945f1ad15e2ea2683beceba (patch)
tree65a9affb01c84ce8776e5ba31f5174da163e74a3 /src
parentFix MyFiniteSetDisjointUnion and pass more tests (diff)
downloadact4e-2b7dbf48d07b3ed9f945f1ad15e2ea2683beceba.tar.gz
act4e-2b7dbf48d07b3ed9f945f1ad15e2ea2683beceba.zip
Fix MyFiniteSetDisjointUnion
Diffstat (limited to '')
-rw-r--r--src/act4e_solutions/sets_sum.py6
1 files 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)