diff options
| -rw-r--r-- | pyisda/credit_index.pyx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/pyisda/credit_index.pyx b/pyisda/credit_index.pyx index bc3ee8f..c93b177 100644 --- a/pyisda/credit_index.pyx +++ b/pyisda/credit_index.pyx @@ -3,6 +3,7 @@ from libc.stdlib cimport malloc, free from libc.math cimport nan from libcpp.pair cimport pair from cython.operator cimport dereference as deref +from cpython cimport PyObject, Py_INCREF cimport cython from legs cimport (JpmcdsCdsContingentLegMake, JpmcdsCdsFeeLegMake, @@ -88,6 +89,8 @@ cdef class CurveList: cdef np.npy_intp shape = self.weights.size() cdef np.ndarray[np.float64_t] out = \ np.PyArray_SimpleNewFromData(1, &shape, np.NPY_DOUBLE, self.weights.data()) + out.base = <PyObject*>self + Py_INCREF(self) return out @property |
