sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.39k stars 473 forks source link

Iteration over infinite abelian groups #30751

Open alexjbest opened 4 years ago

alexjbest commented 4 years ago

Given an AbelianGroup with infinite order generators the __iter__ method silently returns an empty iterator.

sage: for a in AbelianGroup(1,[0]):
....:     print(a)

gives no output.

Either an error should be raised (like for the list method), or ideally an iterator over all elements (by lexicographic order of the powers of generators should be returned, as for

sage: for a in ZZ:
....:     print(a)
....:     if a^2 + a == 30:
....:         break

Component: group theory

Issue created by migration from https://trac.sagemath.org/ticket/30751

mkoeppe commented 3 years ago
comment:2

Setting new milestone based on a cursory review of ticket status, priority, and last modification date.