diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-10-31 14:58:19 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-10-31 14:58:19 +0000 |
commit | 66e484b186c74de4901cdb7783285f4126b65dd0 (patch) | |
tree | f6e640cfc969af22c4c3b74da41e444a0e611554 /numpy/core/src/arrayobject.c | |
parent | d02c44d0712059c51b913771141ffbcd7bdb7506 (diff) | |
download | numpy-66e484b186c74de4901cdb7783285f4126b65dd0.tar.gz |
Revert hasobject to returning True or False
Diffstat (limited to 'numpy/core/src/arrayobject.c')
-rw-r--r-- | numpy/core/src/arrayobject.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c index c953d3516..f07463eb9 100644 --- a/numpy/core/src/arrayobject.c +++ b/numpy/core/src/arrayobject.c @@ -10613,9 +10613,6 @@ static PyMemberDef arraydescr_members[] = { {"byteorder", T_CHAR, offsetof(PyArray_Descr, byteorder), RO, NULL}, {"itemsize", T_INT, offsetof(PyArray_Descr, elsize), RO, NULL}, {"alignment", T_INT, offsetof(PyArray_Descr, alignment), RO, NULL}, - /* Get rid of this in 1.1 */ - {"hasobject", T_UBYTE, offsetof(PyArray_Descr, hasobject), RO, NULL}, - /* END */ {"flags", T_UBYTE, offsetof(PyArray_Descr, hasobject), RO, NULL}, {"names", T_OBJECT, offsetof(PyArray_Descr, names), RO, NULL}, {NULL}, @@ -10795,6 +10792,18 @@ arraydescr_fields_get(PyArray_Descr *self) return PyDictProxy_New(self->fields); } +static PyObject * +arraydescr_hasobject_get(PyArray_Descr *self) +{ + PyObject *res; + if (PyDataType_FLAGCHK(self, NPY_ITEM_HASOBJECT)) + res = Py_True; + else + res = Py_False; + Py_INCREF(res); + return res; +} + static PyGetSetDef arraydescr_getsets[] = { {"subdtype", (getter)arraydescr_subdescr_get, @@ -10822,8 +10831,10 @@ static PyGetSetDef arraydescr_getsets[] = { NULL, NULL}, {"fields", (getter)arraydescr_fields_get, - NULL, - NULL}, + NULL, NULL}, + {"hasobject", + (getter)arraydescr_hasobject_get, + NULL, NULL}, {NULL, NULL, NULL, NULL}, }; |