diff options
Diffstat (limited to 'python/analytics/basket_index.py')
| -rw-r--r-- | python/analytics/basket_index.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/python/analytics/basket_index.py b/python/analytics/basket_index.py index 5fbdd60c..7e131170 100644 --- a/python/analytics/basket_index.py +++ b/python/analytics/basket_index.py @@ -20,9 +20,11 @@ logger = logging.getLogger(__name__) def make_index(t, d, args): - instance = t.__new__(t) - CreditIndex.__init__(instance, *args) - instance.__dict__.update(d) + """ here be dragons """ + instance = t.__new__(t, **d) + if instance.curves == []: + CreditIndex.__init__(instance, *args) + instance.__dict__.update(d) return instance @@ -36,7 +38,7 @@ class BasketIndex(CreditIndex): __cache = {} - def __new__(cls, index_type, series, tenors, *, value_date): + def __new__(cls, index_type, series, tenors, **kwargs): k = (index_type, series, tuple(tenors)) if k in cls.__cache: return cls.__cache[k] |
