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

ValueProxy __reduce_ex__ is unary operator #56

Open
dnephin opened this issue Dec 11, 2013 · 1 comment
Open

ValueProxy __reduce_ex__ is unary operator #56

dnephin opened this issue Dec 11, 2013 · 1 comment
Labels

Comments

@dnephin
Copy link
Owner

dnephin commented Dec 11, 2013

__reduce_ex__ should be added to unary operator list.

  File "/usr/lib/python2.6/copy.py", line 162, in deepcopy
    y = copier(x, memo)
  File "/usr/lib/python2.6/copy.py", line 255, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/lib/python2.6/copy.py", line 162, in deepcopy
    y = copier(x, memo)
  File "/usr/lib/python2.6/copy.py", line 255, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/lib/python2.6/copy.py", line 181, in deepcopy
    rv = reductor(2)
  File "/usr/lib/pymodules/python2.6/staticconf/proxy.py", line 52, in method
    return getattr(operator, name)(self.value, *args)
TypeError: __reduce_ex__() takes at most 1 argument (2 given)
@dnephin
Copy link
Owner Author

dnephin commented May 29, 2014

This method is used for pickling. Pickling a ValueProxy doesn't make much sense anyway (only the underlying .value should be pickled). For now I will remove reduce_ex so that it fails with a better error message of

TypeError: a class that defines __slots__ without defining __getstate__ cannot be pickled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant