From 5a04bc9ae2e8b379b6b03b76e465ad64876e197d Mon Sep 17 00:00:00 2001 From: Travis Oliphant Date: Fri, 11 Aug 2006 20:16:43 +0000 Subject: Allow .astype method to work on data-types with fields. --- numpy/core/src/arraymethods.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'numpy/core/src/arraymethods.c') 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)); } -- cgit v1.2.1