Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deepcopy breaks on ResettableCache #96

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

Comments

Projects
None yet
2 participants
@josef-pkt
Copy link
Member

commented Oct 29, 2011

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

This comment has been minimized.

Copy link
Contributor

commented Aug 26, 2013

Cannot replicate on '0.5.0.dev-90729a3'

@josef-pkt

This comment has been minimized.

Copy link
Member Author

commented Aug 26, 2013

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

This comment has been minimized.

Copy link
Contributor

commented Aug 26, 2013

Yes, no exception raised.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.