summaryrefslogtreecommitdiff
path: root/numpy/lib/polynomial.py
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2017-03-21 21:05:56 +0000
committerEric Wieser <wieser.eric@gmail.com>2017-03-21 21:05:56 +0000
commit0ea21d1092c9154d72d50b04ba2c8025704c679f (patch)
tree268a3c3fdcec56f41c213a8dc0e96158402ba93a /numpy/lib/polynomial.py
parentef6559dd63af3f6140c2011d3c02b4628c6fa766 (diff)
downloadnumpy-0ea21d1092c9154d72d50b04ba2c8025704c679f.tar.gz
BUG: Prevent modification of coefficients
`poly.coeffs = 1` has always failed with a strong exception guarantee. However, `poly.coeffs += 1` would both change the state and fail. Now both fail without affecting the value.
Diffstat (limited to 'numpy/lib/polynomial.py')
-rw-r--r--numpy/lib/polynomial.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py
index ddff0d3b0..e18bbc8bc 100644
--- a/numpy/lib/polynomial.py
+++ b/numpy/lib/polynomial.py
@@ -1041,7 +1041,7 @@ class poly1d(object):
@property
def coeffs(self):
""" The polynomial coefficients """
- return self._coeffs
+ return self._coeffs.copy()
@property
def variable(self):