summaryrefslogtreecommitdiff
path: root/numpy/core/src/arraymethods.c
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-08-11 20:16:43 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-08-11 20:16:43 +0000
commit5a04bc9ae2e8b379b6b03b76e465ad64876e197d (patch)
treee08caf1fb6595247f58ddf861e48958dbf676c84 /numpy/core/src/arraymethods.c
parent59a421dba03c127672e13be07bbbdb81e72f1188 (diff)
downloadnumpy-5a04bc9ae2e8b379b6b03b76e465ad64876e197d.tar.gz
Allow .astype method to work on data-types with fields.
Diffstat (limited to 'numpy/core/src/arraymethods.c')
-rw-r--r--numpy/core/src/arraymethods.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/numpy/core/src/arraymethods.c b/numpy/core/src/arraymethods.c
index a693f42ef..fa7177b16 100644
--- a/numpy/core/src/arraymethods.c
+++ b/numpy/core/src/arraymethods.c
@@ -530,6 +530,9 @@ array_cast(PyArrayObject *self, PyObject *args)
Py_XDECREF(descr);
return obj;
}
+ if (descr->names != NULL) {
+ return PyArray_FromArray(self, descr, 0);
+ }
return _ARET(PyArray_CastToType(self, descr, 0));
}