summaryrefslogtreecommitdiff
path: root/numpy/lib/polynomial.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/polynomial.py')
-rw-r--r--numpy/lib/polynomial.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py
index 50e6d8db2..ddff0d3b0 100644
--- a/numpy/lib/polynomial.py
+++ b/numpy/lib/polynomial.py
@@ -1059,6 +1059,16 @@ class poly1d(object):
""" The roots of the polynomial, where self(x) == 0 """
return roots(self._coeffs)
+ # our internal _coeffs property need to be backed by __dict__['coeffs'] for
+ # scipy to work correctly. Note that as a result, the getter for .coeffs
+ # does not run unless accessed through one of its aliases.
+ @property
+ def _coeffs(self):
+ return self.__dict__['coeffs']
+ @_coeffs.setter
+ def _coeffs(self, coeffs):
+ self.__dict__['coeffs'] = coeffs
+
# alias attributes
r = roots
c = coef = coefficients = coeffs