Implementing nb_inplace_add results in returning a read-only buffer object
问题 I'm writing an implementation of the in-place add operation. But, for some reason, I sometimes get a read-only buffer as result(while I'm adding a custom extension class and an integer...). The relevant code is: static PyObject * ModPoly_InPlaceAdd(PyObject *self, PyObject *other) { if (!ModPoly_Check(self)) { //Since it's in-place addition the control flow should never // enter here(I suppose) if (!ModPoly_Check(other)) { PyErr_SetString(PyExc_TypeError, "Neither argument is a ModPolynomial.