diff options
author | Travis Oliphant <oliphant@enthought.com> | 2007-03-30 23:47:39 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2007-03-30 23:47:39 +0000 |
commit | e784b53e64e22bb4a1a65853505b74d774716cc2 (patch) | |
tree | dd60be8f0456741f8cb5d83ca7433521f3e9766c /numpy/core/src/arrayobject.c | |
parent | 72dea1afaeea8deab2fccb599fba2c7f1f811af3 (diff) | |
download | numpy-e784b53e64e22bb4a1a65853505b74d774716cc2.tar.gz |
Add tests for clipping. Also some good tests on choose and convert_tocommontype. Fix some mixed-type problems. Fix problems with clipping. More to be done to close ticket #425
Diffstat (limited to 'numpy/core/src/arrayobject.c')
-rw-r--r-- | numpy/core/src/arrayobject.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c index 5a5747b1f..4de6bd3be 100644 --- a/numpy/core/src/arrayobject.c +++ b/numpy/core/src/arrayobject.c @@ -10389,6 +10389,7 @@ PyArray_MultiIterNew(int n, ...) PyErr_Format(PyExc_ValueError, "Need between 2 and (%d) " \ "array objects (inclusive).", NPY_MAXARGS); + return NULL; } /* fprintf(stderr, "multi new...");*/ @@ -11972,6 +11973,17 @@ arrayflags_print(PyArrayFlagsObject *self) } +static int +arrayflags_compare(PyArrayFlagsObject *self, PyArrayFlagsObject *other) +{ + if (self->flags == other->flags) + return 0; + else if (self->flags < other->flags) + return -1; + else + return 1; +} + static PyMappingMethods arrayflags_as_mapping = { #if PY_VERSION_HEX >= 0x02050000 (lenfunc)NULL, /*mp_length*/ @@ -12009,7 +12021,7 @@ static PyTypeObject PyArrayFlags_Type = { 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + (cmpfunc)arrayflags_compare, /* tp_compare */ (reprfunc)arrayflags_print, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ |