The list() method does not seem to work properly for (givaro) finite
fields:
sage: K.<a>=GF(4)
sage: [x for x in K]
[0, a, a + 1, 1]
sage: hasattr(K, '__iter__')
True
sage: K.list()
...
TypeError:
'sage.rings.finite_field_givaro.FiniteField_givaro_iterator' object is
not iterable
The culprit looks to me to be in sage/rings/finite_field_givaro.pyx
starting at:
cdef class FiniteField_givaro_iterator:
With some guidance I can probably fix this. Does the iterator need to
inherit from some more general iterator object? Should it be a Python
generator (ie w/ a yield) and then not cdef'ed? Or?
For example, the iterator for a ring of integers mod n seems to be off
in its own pure Python file with a true Python generator.
Suggestions on the nature of a fix (ie the "right" way to do this)
would be appreciated.
Thanks,
Rob