diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-02-14 00:41:38 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-02-14 00:41:38 +0000 |
commit | 2236762d7c08265d5bd59685a0e761a91a3d1f9b (patch) | |
tree | 900949d2cc5c1799d3c95d7b3ca0c1d7abb5859b /numpy/core/src/arraymethods.c | |
parent | b3746796dc5608645ff5a9f4e46b4ef697a51a77 (diff) | |
download | numpy-2236762d7c08265d5bd59685a0e761a91a3d1f9b.tar.gz |
Fix .view to not return scalars.
Diffstat (limited to 'numpy/core/src/arraymethods.c')
-rw-r--r-- | numpy/core/src/arraymethods.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/numpy/core/src/arraymethods.c b/numpy/core/src/arraymethods.c index c4ce3e072..bb35a6575 100644 --- a/numpy/core/src/arraymethods.c +++ b/numpy/core/src/arraymethods.c @@ -155,8 +155,6 @@ array_squeeze(PyArrayObject *self, PyObject *args) return _ARET(PyArray_Squeeze(self)); } - - static char doc_view[] = "a.view(<type>) return a new view of array with same data. type can be either a new sub-type object or a data-descriptor object"; static PyObject * @@ -171,15 +169,15 @@ array_view(PyArrayObject *self, PyObject *args) if (PyType_Check(otype) && \ PyType_IsSubtype((PyTypeObject *)otype, &PyBigArray_Type)) { - return _ARET(PyArray_View(self, NULL, - (PyTypeObject *)otype)); - } + return PyArray_View(self, NULL, + (PyTypeObject *)otype); + } else { if (PyArray_DescrConverter(otype, &type) == PY_FAIL) return NULL; } } - return _ARET(PyArray_View(self, type, NULL)); + return PyArray_View(self, type, NULL); } static char doc_argmax[] = "a.argmax(axis=None)"; @@ -1521,7 +1519,7 @@ array_setflags(PyArrayObject *self, PyObject *args, PyObject *kwds) } static char doc_newbyteorder[] = "a.newbyteorder(<byteorder>) is equivalent\n" \ - " to a.view(a.dtypedescr.newbytorder(<byteorder>))\n"; + " to a.view(a.dtype.newbytorder(<byteorder>))\n"; static PyObject * array_newbyteorder(PyArrayObject *self, PyObject *args) @@ -1534,7 +1532,7 @@ array_newbyteorder(PyArrayObject *self, PyObject *args) new = PyArray_DescrNewByteorder(self->descr, endian); if (!new) return NULL; - return _ARET(PyArray_View(self, new, NULL)); + return PyArray_View(self, new, NULL)); } |