Ticket #7372: trac_7372_finite_field_iteration.patch

File trac_7372_finite_field_iteration.patch, 982 bytes (added by rbeezer, 12 years ago)
  • sage/rings/ring.pyx

    # HG changeset patch
    # User Rob Beezer <beezer@ups.edu>
    # Date 1257119554 28800
    # Node ID 3cdecb61cf1708c48ca230eb55a5a838689070c7
    # Parent  d7363d1b1bdf6d5dae0cbe12aef49a238f7056e0
    [mq]: all-field-iterator
    
    diff -r d7363d1b1bdf -r 3cdecb61cf17 sage/rings/ring.pyx
    a b  
    17691769        """
    17701770        return self.parent(self.iter.next())
    17711771
     1772    def __iter__(self):
     1773        """
     1774        EXAMPLE::
     1775
     1776            sage: K.<a> = GF(2^16)
     1777            sage: elts = K.list() # indirect doctest
     1778            sage: elts[0:10]
     1779            [0, 1, a, a + 1, a^2, a^2 + 1, a^2 + a, a^2 + a + 1, a^3, a^3 + 1]
     1780            sage: elts[2^16-1:2^16]
     1781            [a^15 + a^14 + a^13 + a^12 + a^11 + a^10 + a^9 + a^8 + a^7 + a^6 + a^5 + a^4 + a^3 + a^2 + a + 1]
     1782
     1783        """
     1784        return self
     1785
     1786
    17721787cdef class FiniteField(Field):
    17731788#    def __init__(self):
    17741789#        """