summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorjayvius <jay.bourque@continuum.io>2012-07-12 13:38:17 -0500
committerJay Bourque <jay.bourque@continuum.io>2012-07-17 16:05:10 -0500
commit91cb088047bd357a1b266fa8cb9d0deefea5820c (patch)
tree5265b5957651f8d1e0f3f50177609731dd115228 /numpy
parent0c09e1f184fde335f3533b0b9ef6ea46379309db (diff)
downloadnumpy-91cb088047bd357a1b266fa8cb9d0deefea5820c.tar.gz
Change WARN_ON_WRITE Deprecation Warning
Change WARN_ON_WRITE Deprecation Warning to include returning a copy when selecting muultiple fields of a structured array.
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/src/multiarray/arrayobject.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/numpy/core/src/multiarray/arrayobject.c b/numpy/core/src/multiarray/arrayobject.c
index e8bc6b7b6..4a219e70e 100644
--- a/numpy/core/src/multiarray/arrayobject.c
+++ b/numpy/core/src/multiarray/arrayobject.c
@@ -694,9 +694,10 @@ array_might_be_written(PyArrayObject *obj)
{
const char *msg =
"Numpy has detected that you (may be) writing to an array returned\n"
- "by numpy.diagonal. This code will likely break in the next numpy\n"
- "release -- see numpy.diagonal docs for details. The quick fix is\n"
- "to make an explicit copy (e.g., do arr.diagonal().copy()).";
+ "by numpy.diagonal or by selecting multiple fields in a structured\n"
+ "array. This code will likely break in the next numpy release --\n"
+ "see numpy.diagonal or structured array docs for details. The quick\n"
+ "fix is to make an explicit copy (e.g., do arr.diagonal().copy()).";
if (PyArray_FLAGS(obj) & NPY_ARRAY_WARN_ON_WRITE) {
if (DEPRECATE_FUTUREWARNING(msg) < 0) {
return -1;