internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: numpy/numpy

Issue:
BUG: ndarrays pickled on 1.16.0 cannot be loaded in previous versions
As reported in #12825 in [these](https://github.com/numpy/numpy/issues/12825#issuecomment-456561919) [comments](https://github.com/numpy/numpy/issues/12825#issuecomment-456566648). Should change the module for backward compatibility


Discussion:

Resolving patch:
diff --git a/numpy/core/multiarray.py b/numpy/core/multiarray.py
--- a/numpy/core/multiarray.py
+++ b/numpy/core/multiarray.py
@@ -40,6 +40,10 @@
     'tracemalloc_domain', 'typeinfo', 'unpackbits', 'unravel_index', 'vdot',
     'where', 'zeros']
 
+# For backward compatibility, make sure pickle imports these functions from here
+_reconstruct.__module__ = 'numpy.core.multiarray'
+scalar.__module__ = 'numpy.core.multiarray'
+
 
 arange.__module__ = 'numpy'
 array.__module__ = 'numpy'


Test patch:
diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py
--- a/numpy/core/tests/test_regression.py
+++ b/numpy/core/tests/test_regression.py
@@ -2411,6 +2411,24 @@ def test_field_access_by_title(self):
             if HAS_REFCOUNT:
                 assert_(base <= sys.getrefcount(s))
 
+    @pytest.mark.parametrize('val', [
+        # arrays and scalars
+        np.ones((10, 10), dtype='int32'),
+        np.uint64(10),
+        ])
+    @pytest.mark.parametrize('protocol',
+        range(2, pickle.HIGHEST_PROTOCOL + 1)
+        )
+    def test_pickle_module(self, protocol, val):
+        # gh-12837
+        s = pickle.dumps(val, protocol)
+        assert b'_multiarray_umath' not in s
+        if protocol == 5 and len(val.shape) > 0:
+            # unpickling ndarray goes through _frombuffer for protocol 5
+            assert b'numpy.core.numeric' in s
+        else:
+            assert b'numpy.core.multiarray' in s
+
     def test_object_casting_errors(self):
         # gh-11993
         arr = np.array(['AAAAA', 18465886.0, 18465886.0], dtype=object)
Repository: numpy/numpy

Issue:
ndarray.T does not return self as doc says
<!-- Please describe the issue in detail here, and fill in the fields below -->
`x.T` seems returning *a view of* `x` if `x.ndim < 2`, while the documentation (https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.T.html) says it returns "self".  To me it's not clear what is different between `x.T` and `x.transpose()` except for performance.

### Reproducing code example:

<!-- A short code example that reproduces the problem/missing feature. It should be
self-contained, i.e., possible to run as-is via 'python myproblem.py' -->

```python
import numpy as np
x = np.array([3, 4])
print(x.T is x)  # => False
print(x.T.base is x)  # => True
```

### Numpy/Python version information:
I checked two sets of versions:
```
>>> print(numpy.__version__, sys.version)
1.16.1 3.6.5 (default, Jun 21 2018, 17:25:32)
[GCC 5.4.0 20160609]
```
and
```
>>> print(numpy.__version__, sys.version)
('1.9.3', '2.7.15 (default, Nov  7 2018, 12:21:05) \n[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.10.44.4)]')
```


Discussion:
Yes, you are right, the doc is probably outdated and should be updated. There is no difference, it is simply a convenience shorthand.

Want to create a PR?

Resolving patch:
diff --git a/numpy/core/_add_newdocs.py b/numpy/core/_add_newdocs.py
--- a/numpy/core/_add_newdocs.py
+++ b/numpy/core/_add_newdocs.py
@@ -2450,8 +2450,9 @@
 
 add_newdoc('numpy.core.multiarray', 'ndarray', ('T',
     """
-    Same as self.transpose(), except that self is returned if
-    self.ndim < 2.
+    The transposed array.
+
+    Same as ``self.transpose()``.
 
     Examples
     --------
@@ -2468,6 +2469,10 @@
     >>> x.T
     array([ 1.,  2.,  3.,  4.])
 
+    See Also
+    --------
+    transpose
+
     """))
 
 


Test patch:
Repository: numpy/numpy

Issue:
Imprecise docstring for np.pad
Excerpt of the docstring for np.pad
```
    constant_values : sequence or int, optional
        Used in 'constant'.  The values to set the padded values for each
        axis.

        ((before_1, after_1), ... (before_N, after_N)) unique pad constants
        for each axis.

        ((before, after),) yields same before and after constants for each
        axis.

        (constant,) or int is a shortcut for before = after = constant for  # <---- HERE
        all axes.

        Default is 0.
    end_values : sequence or int, optional
        Used in 'linear_ramp'.  The values used for the ending value of the
        linear_ramp and that will form the edge of the padded array.

        ((before_1, after_1), ... (before_N, after_N)) unique end values
        for each axis.

        ((before, after),) yields same before and after end values for each
        axis.

        (constant,) or int is a shortcut for before = after = end value for  # <---- PERHAPS TOO
        all axes.

        Default is 0.
```
Since #6026 has been fixed the first "int" should be replaced by "scalar" or "constant".  Not sure about the second one.


Discussion:

Resolving patch:
diff --git a/numpy/lib/arraypad.py b/numpy/lib/arraypad.py
--- a/numpy/lib/arraypad.py
+++ b/numpy/lib/arraypad.py
@@ -1026,31 +1026,31 @@ def pad(array, pad_width, mode, **kwargs):
         length for all axes.
 
         Default is ``None``, to use the entire axis.
-    constant_values : sequence or int, optional
+    constant_values : sequence or scalar, optional
         Used in 'constant'.  The values to set the padded values for each
         axis.
 
-        ((before_1, after_1), ... (before_N, after_N)) unique pad constants
+        ``((before_1, after_1), ... (before_N, after_N))`` unique pad constants
         for each axis.
 
-        ((before, after),) yields same before and after constants for each
+        ``((before, after),)`` yields same before and after constants for each
         axis.
 
-        (constant,) or int is a shortcut for before = after = constant for
+        ``(constant,)`` or ``constant`` is a shortcut for ``before = after = constant`` for
         all axes.
 
         Default is 0.
-    end_values : sequence or int, optional
+    end_values : sequence or scalar, optional
         Used in 'linear_ramp'.  The values used for the ending value of the
         linear_ramp and that will form the edge of the padded array.
 
-        ((before_1, after_1), ... (before_N, after_N)) unique end values
+        ``((before_1, after_1), ... (before_N, after_N))`` unique end values
         for each axis.
 
-        ((before, after),) yields same before and after end values for each
+        ``((before, after),)`` yields same before and after end values for each
         axis.
 
-        (constant,) or int is a shortcut for before = after = end value for
+        ``(constant,)`` or ``constant`` is a shortcut for ``before = after = constant`` for
         all axes.
 
         Default is 0.


Test patch:
Repository: numpy/numpy

Issue:
Documentation mistake numpy.floor_divide
The [floor_divide docs](https://docs.scipy.org/doc/numpy/reference/generated/numpy.floor_divide.html) claim that 

> Return the largest integer smaller or equal to the division of the inputs. It is equivalent to the Python // operator and pairs with the Python % (remainder), function so that b = a % b + b * (a // b) up to roundoff.

However, the mathematical expression is equal to a, not equal to b.

### Reproducing code example:

```
a=9; b=2; a % b + b * (a // b)  == a
True
```

### Numpy/Python version information:

Numpy docs V1.16.1


Discussion:
Hello, I'm new to open source and would like to work on this if no one is.
Please just go ahead, in case you are thinking about Outreachy. Especially also in that case, please look into building the documentation locally as well.

For some general notes about our workflow have a short look at: http://www.numpy.org/devdocs/dev/gitwash/development_workflow.html.

For instructions on building the documentation, see:
http://www.numpy.org/devdocs/docs/index.html?highlight=documentation

(One quick way to get into a shell to run `make html` which uses the development numpy version may be to use `python runtests.py --shell`)
Hi Im Interested in solving the issue
On it. Thanks @seberg 
hey! I am an Outreachy Applicant. I am interested in solving this issue.
@RuchikaChugh, @SahanaJavgal please choose another issue.

Resolving patch:
diff --git a/numpy/core/code_generators/ufunc_docstrings.py b/numpy/core/code_generators/ufunc_docstrings.py
--- a/numpy/core/code_generators/ufunc_docstrings.py
+++ b/numpy/core/code_generators/ufunc_docstrings.py
@@ -1313,7 +1313,7 @@ def add_newdoc(place, name, doc):
     """
     Return the largest integer smaller or equal to the division of the inputs.
     It is equivalent to the Python ``//`` operator and pairs with the
-    Python ``%`` (`remainder`), function so that ``b = a % b + b * (a // b)``
+    Python ``%`` (`remainder`), function so that ``a = a % b + b * (a // b)``
     up to roundoff.
 
     Parameters
@@ -2607,7 +2607,7 @@ def add_newdoc(place, name, doc):
 
     >>> a = np.array([[1, 0],
     ...               [0, 1]])
-    >>> b = np.array([[4, 1], 
+    >>> b = np.array([[4, 1],
     ...               [2, 2]])
     >>> np.matmul(a, b)
     array([[4, 1],
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -3450,7 +3450,7 @@ def mask(self):
         # We could try to force a reshape, but that wouldn't work in some
         # cases.
         return self._mask
-    
+
     @mask.setter
     def mask(self, value):
         self.__setmask__(value)


Test patch:
Repository: numpy/numpy

Issue:
np.savetxt bug on structured array
<!-- Please describe the issue in detail here, and fill in the fields below -->
Saving numpy array subsampled by multi-field indexing fails.

### Reproducing code example:

<!-- A short code example that reproduces the problem/missing feature. It should be
self-contained, i.e., possible to run as-is via 'python myproblem.py' -->

```python
import numpy as np
x = np.array([(1,2,3),(4,5,6)], dtype=[('foo', 'i8'), ('bar', 'f4'), ('yee', 'f4')])
np.savetxt('out.txt', x[['foo', 'yee']])
```

<!-- Remove these sections for a feature request -->

### Error message:
TypeError: Mismatch between array dtype ('{'names':['foo','yee'], 'formats':['<i8','<f4'], 'offsets':[0,12], 'itemsize':16}') and format specifier ('%.18e %.18e %.18e')
<!-- If you are reporting a segfault please include a GDB traceback, which you
can generate by following
https://github.com/numpy/numpy/blob/master/doc/source/dev/development_environment.rst#debugging -->

<!-- Full error message, if any (starting from line Traceback: ...) -->

### Numpy/Python version information:
('1.16.2', '2.7.16 |Anaconda, Inc.| (default, Mar 14 2019, 21:00:58) \n[GCC 7.3.0]')

<!-- Output from 'import sys, numpy; print(numpy.__version__, sys.version)' -->




Discussion:
Following along in this thread

https://github.com/numpy/numpy/issues/13299

y = rf.repack_fields(x[['foo', 'yee']])
np.savetxt('c:/temp/out.txt', y)

was the only thing that didn't raise the error you posted.

Resolving patch:
diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py
--- a/numpy/lib/npyio.py
+++ b/numpy/lib/npyio.py
@@ -1379,7 +1379,7 @@ def first_write(self, v):
 
             # Complex dtype -- each field indicates a separate column
             else:
-                ncol = len(X.dtype.descr)
+                ncol = len(X.dtype.names)
         else:
             ncol = X.shape[1]
 


Test patch:
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py
--- a/numpy/lib/tests/test_io.py
+++ b/numpy/lib/tests/test_io.py
@@ -347,13 +347,23 @@ def test_0D_3D(self):
         assert_raises(ValueError, np.savetxt, c, np.array(1))
         assert_raises(ValueError, np.savetxt, c, np.array([[[1], [2]]]))
 
-    def test_record(self):
+    def test_structured(self):
         a = np.array([(1, 2), (3, 4)], dtype=[('x', 'i4'), ('y', 'i4')])
         c = BytesIO()
         np.savetxt(c, a, fmt='%d')
         c.seek(0)
         assert_equal(c.readlines(), [b'1 2\n', b'3 4\n'])
 
+    def test_structured_padded(self):
+        # gh-13297
+        a = np.array([(1, 2, 3),(4, 5, 6)], dtype=[
+            ('foo', 'i4'), ('bar', 'i4'), ('baz', 'i4')
+        ])
+        c = BytesIO()
+        np.savetxt(c, a[['foo', 'baz']], fmt='%d')
+        c.seek(0)
+        assert_equal(c.readlines(), [b'1 3\n', b'4 6\n'])
+
     @pytest.mark.skipif(Path is None, reason="No pathlib.Path")
     def test_multifield_view(self):
         a = np.ones(1, dtype=[('x', 'i4'), ('y', 'i4'), ('z', 'f4')])
Repository: numpy/numpy

Issue:
BUILD: what is generate_mtrand_c.py ?
xref #13163 

Does anyone know what is ['numpy/random/mtrand/generate_mtrand_c.py'](https://github.com/numpy/numpy/blob/v1.16.2/numpy/random/mtrand/generate_mtrand_c.py) and why it is in ['MANIFEST.in'](https://github.com/numpy/numpy/blob/v1.16.2/MANIFEST.in#L11) ? Is it used by some downstream package? It does not seem to be used in [creating the wheels](https://github.com/MacPython/numpy-wheels)


Discussion:
It used to be around to generate the `mtrand.c` file. The reason was the not everyone had cython installed, and the `mtrand.c` file was actually checked into git. I am not sure that script does much except run cython on `mtrand.pyx` and I think nowadays the build process just does that. So I think it should be safe to delete it.

Resolving patch:
diff --git a/numpy/random/mtrand/generate_mtrand_c.py b/numpy/random/mtrand/generate_mtrand_c.py
deleted file mode 100644
--- a/numpy/random/mtrand/generate_mtrand_c.py
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/env python
-from __future__ import division, absolute_import, print_function
-
-import sys
-import re
-import os
-
-unused_internal_funcs = ['__Pyx_PrintItem',
-                         '__Pyx_PrintNewline',
-                         '__Pyx_ReRaise',
-                         #'__Pyx_GetExcValue',
-                         '__Pyx_ArgTypeTest',
-                         '__Pyx_SetVtable',
-                         '__Pyx_GetVtable',
-                         '__Pyx_CreateClass']
-
-if __name__ == '__main__':
-    # Use cython here so that long docstrings are broken up.
-    # This is needed for some VC++ compilers.
-    os.system('cython mtrand.pyx')
-    mtrand_c = open('mtrand.c', 'r')
-    processed = open('mtrand_pp.c', 'w')
-    unused_funcs_str = '(' + '|'.join(unused_internal_funcs) + ')'
-    uifpat = re.compile(r'static \w+ \*?'+unused_funcs_str+r'.*/\*proto\*/')
-    linepat = re.compile(r'/\* ".*/mtrand.pyx":')
-    for linenum, line in enumerate(mtrand_c):
-        m = re.match(r'^(\s+arrayObject\w*\s*=\s*[(])[(]PyObject\s*[*][)]',
-                     line)
-        if m:
-            line = '%s(PyArrayObject *)%s' % (m.group(1), line[m.end():])
-        m = uifpat.match(line)
-        if m:
-            line = ''
-        m = re.search(unused_funcs_str, line)
-        if m:
-            print("%s was declared unused, but is used at line %d" % (m.group(),
-                                                                    linenum+1), file=sys.stderr)
-        line = linepat.sub(r'/* "mtrand.pyx":', line)
-        processed.write(line)
-    mtrand_c.close()
-    processed.close()
-    os.rename('mtrand_pp.c', 'mtrand.c')


Test patch:
Repository: numpy/numpy

Issue:
np.conj vs np.conjugate
Both ``numpy.conj`` and ``numpy.conjugate`` exist, and in fact the docs for ``conj`` show examples that use ``conjugate``:

https://docs.scipy.org/doc/numpy-1.12.0/reference/generated/numpy.conj.html

Furthermore, the page for numpy.conjugate doesn't exist. It would be nice to make this more consistent, e.g. change the examples in for the ``conj`` page to use ``conjugate``, or add a note to the ``conj`` docs that either can be used.


Discussion:
While we're at it, probably good to ensure we note that they are, in fact, just aliases:
```
In [2]: np.conj is np.conjugate
Out[2]: True
```
See also `np.max` and `np.amax`, for which I feel we should be encouraging the former
Hi. I would like to take this up and wanted to propose a workflow.
We can create a separate page for `np.conjugate` as well and include relevant examples in that page. Also, change the examples in `np.conj` page to use `conj` and mention in both the pages that they are aliases of each other and provide reference in the `See Also` section. 
This is to maintain consistency with the documentation of aliases as is done with for e.g., `np.random.random` function Please let me know if I can go ahead with this flow. Thanks!
@kritisingh1 - since the two functions are the same -- `np.conj is np.conjugate` -- you only need to update the one docstring that they share. I think I would use `np.conjugate` everywhere, since it is generally good not to use abbreviations (and  `conj` is created explicitly as an alias in `ufuncmodule.c`). Also, that happens to need the least change: the docstring could just mention that `np.conj` is an alias. To save you searching: the docstrings are in `numpy/core/code_generators/ufunc_docstrings.py`

Then, the next step is to ensure that documentation pages for both functions get generated. Here, you have to adjust both `docs/source/reference/routines.umath.src` and `docs/source/reference/ufuncs.rst`.

While you are at it, would it be possible to also also update the docstring of `remainder` to mention `mod` is an alias? Also, I'm not quite sure the list in `ufuncs.rst` is in fact up to date. It might be good to compare with what we actually expose:
```
import numpy
ufuncs = [key for key in dir(numpy) if isinstance(getattr(numpy, key), numpy.ufunc)]
```

Resolving patch:
diff --git a/numpy/core/code_generators/ufunc_docstrings.py b/numpy/core/code_generators/ufunc_docstrings.py
--- a/numpy/core/code_generators/ufunc_docstrings.py
+++ b/numpy/core/code_generators/ufunc_docstrings.py
@@ -793,6 +793,13 @@ def add_newdoc(place, name, doc):
         The complex conjugate of `x`, with same dtype as `y`.
         $OUT_SCALAR_1
 
+    Notes
+    -----
+    `conj` is an alias for `conjugate`:
+
+    >>> np.conj is np.conjugate
+    True
+
     Examples
     --------
     >>> np.conjugate(1+2j)
@@ -3079,6 +3086,7 @@ def add_newdoc(place, name, doc):
     -----
     Returns 0 when `x2` is 0 and both `x1` and `x2` are (arrays of)
     integers.
+    ``mod`` is an alias of ``remainder``.
 
     Examples
     --------


Test patch:
Repository: numpy/numpy

Issue:
np.savetxt bug on structured array
<!-- Please describe the issue in detail here, and fill in the fields below -->
Saving numpy array subsampled by multi-field indexing fails.

### Reproducing code example:

<!-- A short code example that reproduces the problem/missing feature. It should be
self-contained, i.e., possible to run as-is via 'python myproblem.py' -->

```python
import numpy as np
x = np.array([(1,2,3),(4,5,6)], dtype=[('foo', 'i8'), ('bar', 'f4'), ('yee', 'f4')])
np.savetxt('out.txt', x[['foo', 'yee']])
```

<!-- Remove these sections for a feature request -->

### Error message:
TypeError: Mismatch between array dtype ('{'names':['foo','yee'], 'formats':['<i8','<f4'], 'offsets':[0,12], 'itemsize':16}') and format specifier ('%.18e %.18e %.18e')
<!-- If you are reporting a segfault please include a GDB traceback, which you
can generate by following
https://github.com/numpy/numpy/blob/master/doc/source/dev/development_environment.rst#debugging -->

<!-- Full error message, if any (starting from line Traceback: ...) -->

### Numpy/Python version information:
('1.16.2', '2.7.16 |Anaconda, Inc.| (default, Mar 14 2019, 21:00:58) \n[GCC 7.3.0]')

<!-- Output from 'import sys, numpy; print(numpy.__version__, sys.version)' -->




Discussion:
Following along in this thread

https://github.com/numpy/numpy/issues/13299

y = rf.repack_fields(x[['foo', 'yee']])
np.savetxt('c:/temp/out.txt', y)

was the only thing that didn't raise the error you posted.

Resolving patch:
diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py
--- a/numpy/lib/npyio.py
+++ b/numpy/lib/npyio.py
@@ -1376,7 +1376,7 @@ def first_write(self, v):
 
             # Complex dtype -- each field indicates a separate column
             else:
-                ncol = len(X.dtype.descr)
+                ncol = len(X.dtype.names)
         else:
             ncol = X.shape[1]
 


Test patch:
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py
--- a/numpy/lib/tests/test_io.py
+++ b/numpy/lib/tests/test_io.py
@@ -347,13 +347,23 @@ def test_0D_3D(self):
         assert_raises(ValueError, np.savetxt, c, np.array(1))
         assert_raises(ValueError, np.savetxt, c, np.array([[[1], [2]]]))
 
-    def test_record(self):
+    def test_structured(self):
         a = np.array([(1, 2), (3, 4)], dtype=[('x', 'i4'), ('y', 'i4')])
         c = BytesIO()
         np.savetxt(c, a, fmt='%d')
         c.seek(0)
         assert_equal(c.readlines(), [b'1 2\n', b'3 4\n'])
 
+    def test_structured_padded(self):
+        # gh-13297
+        a = np.array([(1, 2, 3),(4, 5, 6)], dtype=[
+            ('foo', 'i4'), ('bar', 'i4'), ('baz', 'i4')
+        ])
+        c = BytesIO()
+        np.savetxt(c, a[['foo', 'baz']], fmt='%d')
+        c.seek(0)
+        assert_equal(c.readlines(), [b'1 3\n', b'4 6\n'])
+
     @pytest.mark.skipif(Path is None, reason="No pathlib.Path")
     def test_multifield_view(self):
         a = np.ones(1, dtype=[('x', 'i4'), ('y', 'i4'), ('z', 'f4')])
Repository: numpy/numpy

Issue:
poly1d coefficients appear to be immutable
In some older versions of numpy, it was possible to change the coefficients of a `poly1d` object.  Now it seems not possible.  According to https://github.com/numpy/numpy/issues/9385 I believe the coefficients should still be mutable.

### Reproducing code example:



```python
import numpy as np
import numpy
p = numpy.poly1d((1,1))
print(p)
p.c[0]=0
print(p)
```
Both print statements print `array([1, 1])`.  

### Numpy/Python version information:

I am using numpy version 1.16.2.



Discussion:

Resolving patch:
diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py
--- a/numpy/lib/polynomial.py
+++ b/numpy/lib/polynomial.py
@@ -1111,8 +1111,14 @@ class poly1d(object):
 
     @property
     def coeffs(self):
-        """ A copy of the polynomial coefficients """
-        return self._coeffs.copy()
+        """ The polynomial coefficients """
+        return self._coeffs
+
+    @coeffs.setter
+    def coeffs(self, value):
+        # allowing this makes p.coeffs *= 2 legal
+        if value is not self._coeffs:
+            raise AttributeError("Cannot set attribute")
 
     @property
     def variable(self):


Test patch:
diff --git a/numpy/lib/tests/test_polynomial.py b/numpy/lib/tests/test_polynomial.py
--- a/numpy/lib/tests/test_polynomial.py
+++ b/numpy/lib/tests/test_polynomial.py
@@ -246,16 +246,16 @@ def test_polydiv(self):
         assert_equal(r.coeffs.dtype, np.complex128)
         assert_equal(q*a + r, b)
 
-    def test_poly_coeffs_immutable(self):
-        """ Coefficients should not be modifiable """
+    def test_poly_coeffs_mutable(self):
+        """ Coefficients should be modifiable """
         p = np.poly1d([1, 2, 3])
 
-        try:
-            # despite throwing an exception, this used to change state
-            p.coeffs += 1
-        except Exception:
-            pass
-        assert_equal(p.coeffs, [1, 2, 3])
+        p.coeffs += 1
+        assert_equal(p.coeffs, [2, 3, 4])
 
         p.coeffs[2] += 10
-        assert_equal(p.coeffs, [1, 2, 3])
+        assert_equal(p.coeffs, [2, 3, 14])
+
+        # this never used to be allowed - let's not add features to deprecated
+        # APIs
+        assert_raises(AttributeError, setattr, p, 'coeffs', np.array(1))