We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e2433f6 commit 4c5a738Copy full SHA for 4c5a738
src/sage/groups/abelian_gps/abelian_group.py
@@ -1314,14 +1314,13 @@ def __iter__(self):
1314
invs = self.gens_orders()
1315
if 0 not in invs:
1316
# The group is finite
1317
- for t in mrange(invs):
1318
- yield self(t)
+ yield from map(self, mrange(invs))
1319
else:
1320
# A similar approach works for infinite groups.
1321
# (This would also work for finite groups, but is more complicated.)
1322
from sage.misc.mrange import cantor_product
1323
- for t in cantor_product(*[range(n) if n > 0 else ZZ for n in invs]):
1324
+ yield from map(self, cantor_product(*[range(n) if n
+ else ZZ for n in invs]))
1325
1326
def number_of_subgroups(self, order=None):
1327
r"""
0 commit comments