diff options
author | Stefan van der Walt <stefan@sun.ac.za> | 2008-04-30 22:06:41 +0000 |
---|---|---|
committer | Stefan van der Walt <stefan@sun.ac.za> | 2008-04-30 22:06:41 +0000 |
commit | e285208a309b44ccc88e28c60140474acb7cc83b (patch) | |
tree | e8f92f17aeb27b78e51cc4c44f1eb991f347df32 /numpy/core/src/arraymethods.c | |
parent | 21a7341b383356ba99c10eda9654a4470e1247a0 (diff) | |
download | numpy-e285208a309b44ccc88e28c60140474acb7cc83b.tar.gz |
For x.view, change dtype into keyword argument.
Diffstat (limited to 'numpy/core/src/arraymethods.c')
-rw-r--r-- | numpy/core/src/arraymethods.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/numpy/core/src/arraymethods.c b/numpy/core/src/arraymethods.c index 587bffedc..cfd912644 100644 --- a/numpy/core/src/arraymethods.c +++ b/numpy/core/src/arraymethods.c @@ -101,12 +101,14 @@ array_squeeze(PyArrayObject *self, PyObject *args) } static PyObject * -array_view(PyArrayObject *self, PyObject *args) +array_view(PyArrayObject *self, PyObject *args, PyObject *kwds) { PyObject *otype=NULL; PyArray_Descr *type=NULL; - if (!PyArg_ParseTuple(args, "|O", &otype)) return NULL; + static char *kwlist[] = {"dtype", NULL}; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O", kwlist, &otype)) + return NULL; if (otype) { if (PyType_Check(otype) && \ @@ -1994,7 +1996,7 @@ static PyMethodDef array_methods[] = { {"var", (PyCFunction)array_variance, METH_VARARGS | METH_KEYWORDS, NULL}, {"view", (PyCFunction)array_view, - METH_VARARGS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {NULL, NULL} /* sentinel */ }; |