deepcopy breaks on ResettableCache #96

Closed
josef-pkt opened this Issue Oct 29, 2011 · 3 comments

Projects

None yet

2 participants

@josef-pkt
Member

after running example_discrete.py, deepcopy doesn't work for mlogit results

>>> import copy
>>> copy.deepcopy(mlogit_res)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python26\lib\copy.py", line 189, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "C:\Python26\lib\copy.py", line 338, in _reconstruct
    state = deepcopy(state, memo)
  File "C:\Python26\lib\copy.py", line 162, in deepcopy
    y = copier(x, memo)
  File "C:\Python26\lib\copy.py", line 255, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "C:\Python26\lib\copy.py", line 189, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "C:\Python26\lib\copy.py", line 338, in _reconstruct
    state = deepcopy(state, memo)
  File "C:\Python26\lib\copy.py", line 162, in deepcopy
    y = copier(x, memo)
  File "C:\Python26\lib\copy.py", line 255, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "C:\Python26\lib\copy.py", line 189, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "C:\Python26\lib\copy.py", line 335, in _reconstruct
    y[key] = value
  File "e:\josef\eclipsegworkspace\statsmodels-git\statsmodels-josef\scikits\statsmodels\tools\decorators.py", line 52, in __setitem__
    for mustreset in self._resetdict.get(key, []):
AttributeError: 'ResettableCache' object has no attribute '_resetdict'
@vincentarelbundock
Member

Cannot replicate on '0.5.0.dev-90729a3'

@josef-pkt
Member

If that means deepcopy doesn't raise an exception, then you can close this issue.

I don't remember why I was looking at deepcopy, maybe for cloning a model and result instance.

@vincentarelbundock
Member

Yes, no exception raised.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment