-
Notifications
You must be signed in to change notification settings - Fork 275
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
pickle protocol #229
Comments
I'm not sure what concretely you're suggesting. Currently, six's only interaction with pickle is providing a mapping between |
If the objective of something like this might work?
|
Why can't you use |
Do you mean in the diff above? I suppose you could, but you'd have to import it somewhere, and the lazy initialization wouldn't let you do that in a very easily. I'm guessing you didn't mean in the diff. I wouldn't use |
Correct.
I don't think writing We can't make a change like you propose above because it would change the API of six in a backwards-incompatible way. |
Thanks for hearing me out and responding. At this point, it doesn't really impact me much since I've already adjusted my code. It was a pain to figure out, and something that I thought would have "just worked" with I understand that you are closing it, but not sure I understand the "backwards incompatible way." the various demonstration of breaking backwards compatibility
demonstration of breaking forward compatibility
Thanks for making |
Whether it's good or not, the current behavior of |
It seems as though it would be helpful to modify the
pickle.dump(s)
methods to useprotocol=HIGHEST_PROTOCOL
, as this would be consistent with Python3 and should be functional in Python2.6+ (stated functionality of six).The default Python2 protocol is 0, which require
__getstate__
and__setstate__
methods; however Python 3 usesprotocol=HIGEST_PROTCOL
(equivalent to 4 since Python 3.4).Manipulating the
dump(s)
methods to use the highest protocol would allow someone to write the most "slim" code that will work in both Python2 and Python3.The text was updated successfully, but these errors were encountered: