summaryrefslogtreecommitdiff
path: root/numpy/core/src/arrayobject.c
diff options
context:
space:
mode:
authorsasha <sasha@localhost>2006-01-11 00:17:47 +0000
committersasha <sasha@localhost>2006-01-11 00:17:47 +0000
commit743d922bf5893acf00ac92e823fe12f460726f90 (patch)
tree8a59ee157af61828a7d0a49d1dc064b055400d3a /numpy/core/src/arrayobject.c
parent52c1871f6e840bb46bbd1df6f44501e896f73495 (diff)
downloadnumpy-743d922bf5893acf00ac92e823fe12f460726f90.tar.gz
implemented a[...] = v and a[()] = v for zero rank a
Diffstat (limited to 'numpy/core/src/arrayobject.c')
-rw-r--r--numpy/core/src/arrayobject.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c
index b89e787d4..7e0d0d240 100644
--- a/numpy/core/src/arrayobject.c
+++ b/numpy/core/src/arrayobject.c
@@ -1938,6 +1938,9 @@ array_ass_sub(PyArrayObject *self, PyObject *index, PyObject *op)
}
if (self->nd == 0) {
+ if (index == Py_Ellipsis ||
+ PyTuple_Check(index) && 0 == PyTuple_GET_SIZE(index))
+ return self->descr->f->setitem(op, self->data, self);
PyErr_SetString(PyExc_IndexError,
"0-d arrays can't be indexed.");
return -1;