diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-07-07 18:55:19 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-07-07 18:55:19 +0000 |
commit | d896e9ee78d865474ab85c64a648c05834225966 (patch) | |
tree | de6feb80ca57fb10d63bd787bac14ebee7d2ed12 /numpy/core/src/arrayobject.c | |
parent | 5ee14815b3520074e73b2b2836a8a11de0cc9fc2 (diff) | |
download | numpy-d896e9ee78d865474ab85c64a648c05834225966.tar.gz |
Make .T == .transpose()
Diffstat (limited to 'numpy/core/src/arrayobject.c')
-rw-r--r-- | numpy/core/src/arrayobject.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c index f305a9b89..19febf726 100644 --- a/numpy/core/src/arrayobject.c +++ b/numpy/core/src/arrayobject.c @@ -6184,34 +6184,11 @@ array_flat_set(PyArrayObject *self, PyObject *val) static PyObject * array_transpose_get(PyArrayObject *self) { - intp dims[2]; - intp strides[2]; - PyObject *new; - - switch(self->nd) { - case 0: + if (self->nd < 2) { Py_INCREF(self); return (PyObject *)self; - case 1: - dims[0] = self->dimensions[0]; - dims[1] = 1; - strides[0] = self->strides[0]; - strides[1] = 0; - Py_INCREF(self->descr); - new = PyArray_NewFromDescr(self->ob_type, - self->descr, - 2, dims, - strides, - self->data, - self->flags, - (PyObject *)self); - if (new==NULL) return NULL; - Py_INCREF(self); - PyArray_BASE(new) = (PyObject *)self; - return new; - default: - return PyArray_Transpose(self, NULL); } + return PyArray_Transpose(self, NULL); } /* If this is None, no function call is made |