diff options
| author | Guillaume Horel <guillaume.horel@gmail.com> | 2017-11-30 15:02:58 -0500 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@gmail.com> | 2017-11-30 15:02:58 -0500 |
| commit | 1f002220584a030e8cbad2fe2f678868ac95364b (patch) | |
| tree | fce999464661282df4c60aa380bfcbae5a5880de | |
| parent | 87bce7a101ca0a411c86e39a0f3c6904824b1722 (diff) | |
| download | pyisda-1f002220584a030e8cbad2fe2f678868ac95364b.tar.gz | |
Revert "try __get/setstate__"
This reverts commit 87bce7a101ca0a411c86e39a0f3c6904824b1722.
| -rw-r--r-- | pyisda/credit_index.pyx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/pyisda/credit_index.pyx b/pyisda/credit_index.pyx index 8c471f9..163f2f1 100644 --- a/pyisda/credit_index.pyx +++ b/pyisda/credit_index.pyx @@ -202,11 +202,8 @@ cdef class CurveList: copy.tickers = self.tickers return copy - def __getstate__(self): - return (self.curves, self.weights) - - def __setstate__(self, state): - return self.__class__(*state) + def __reduce__(self): + return (self.__class__, (self.curves, self.weights)) @cython.auto_pickle(False) cdef class CreditIndex(CurveList): @@ -279,8 +276,9 @@ cdef class CreditIndex(CurveList): copy.contingent_legs[i] = copyContingentLeg(self.contingent_legs[i]) return copy - def __getstate__(self): - return (TDate_to_pydate(self.start_date), self.maturities, self.curves, self.weights) + def __reduce__(self): + return (self.__class__, + (TDate_to_pydate(self.start_date), self.maturities, self.curves, self.weights)) def __hash__(self): cdef: |
