From 966f72172faafa66fa1b43c6fcba4548377e3fdb Mon Sep 17 00:00:00 2001 From: = <=> Date: Tue, 6 Feb 2024 17:35:56 +0100 Subject: [PATCH] chain is weird --- python/polycube.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/polycube.py b/python/polycube.py index 7b3109b..8c6a9ac 100644 --- a/python/polycube.py +++ b/python/polycube.py @@ -27,7 +27,7 @@ class PolyCube: for last_addition in self.last_additions: growth_candidates = growth_candidates.union(generate_neighbors(*last_addition)) growth_candidates = growth_candidates.difference(self.cubes) - realizable_growth = chain(combinations(growth_candidates, i) for i in range(1, max_growth+1)) + realizable_growth = chain.from_iterable(combinations(growth_candidates, i) for i in range(1, max_growth+1)) for addition in realizable_growth: yield PolyCube(self.cubes.union(addition), addition)