Rob Beezer
unread,Oct 31, 2009, 4:47:27 PM10/31/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sage-devel
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