| 788 | */ |
| 789 | |
| 790 | static PyObject * |
| 791 | array_imag_get(PyArrayObject *self, void *NPY_UNUSED(ignored)) |
| 792 | { |
| 793 | PyArrayObject *ret; |
| 794 | |
| 795 | if (PyArray_ISCOMPLEX(self)) { |
| 796 | ret = _get_part(self, 1); |
| 797 | } |
| 798 | else { |
| 799 | Py_INCREF(PyArray_DESCR(self)); |
| 800 | ret = (PyArrayObject *)PyArray_NewFromDescr_int( |
| 801 | Py_TYPE(self), |
| 802 | PyArray_DESCR(self), |
| 803 | PyArray_NDIM(self), |
| 804 | PyArray_DIMS(self), |
| 805 | NULL, NULL, |
| 806 | PyArray_ISFORTRAN(self), |
| 807 | (PyObject *)self, NULL, _NPY_ARRAY_ZEROED); |
| 808 | if (ret == NULL) { |
| 809 | return NULL; |
| 810 | } |
| 811 | PyArray_CLEARFLAGS(ret, NPY_ARRAY_WRITEABLE); |
| 812 | } |
| 813 | return (PyObject *) ret; |
| 814 | } |
| 815 | |
| 816 | static int |
| 817 | array_imag_set(PyArrayObject *self, PyObject *val, void *NPY_UNUSED(ignored)) |
nothing calls this directly
no test coverage detected