From 9949bc651f2213f2ac3567365a57a61f67a77772 Mon Sep 17 00:00:00 2001 From: cookedm Date: Thu, 31 May 2007 22:11:24 +0000 Subject: Add __iter__ method to poly1d so that list() on a poly1d doesn't go into an infinite loop --- numpy/lib/polynomial.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'numpy/lib') diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py index b35926900..6964277a3 100644 --- a/numpy/lib/polynomial.py +++ b/numpy/lib/polynomial.py @@ -641,6 +641,9 @@ class poly1d(object): self.__dict__['coeffs'][ind] = val return + def __iter__(self): + return iter(self.coeffs) + def integ(self, m=1, k=0): """Return the mth analytical integral of this polynomial. See the documentation for polyint. -- cgit v1.2.1