Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Reinstate next() method for Py2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
kedlaya committed Dec 25, 2019
1 parent e0b9ff9 commit 7f44a49
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/sage/rings/polynomial/weil/weil_polynomials.pyx
Expand Up @@ -367,6 +367,22 @@ class WeilPolynomials_iter():
raise StopIteration
return self.pol(self.ans.pop())

def next(self): # For Python2 backward compatibility
r"""
Step the iterator forward.
Included for Python2 backward compatibility.
EXAMPLES::
sage: from sage.rings.polynomial.weil.weil_polynomials import WeilPoynomials
sage: w = WeilPolynomials(10,1,sign=1,lead=[3,1,1])
sage: it = iter(w)
sage: next(it)
3*x^10 + x^9 + x^8 + 7*x^7 + 5*x^6 + 2*x^5 + 5*x^4 + 7*x^3 + x^2 + x 3
"""
return self.__next__()

def node_count(self):
r"""
Return the number of terminal nodes found in the tree, excluding
Expand Down

0 comments on commit 7f44a49

Please sign in to comment.