-
-
Notifications
You must be signed in to change notification settings - Fork 18
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 support #147
Pickle support #147
Conversation
@@ -156,6 +156,9 @@ def __new__(cls, *args, **kwargs): | |||
|
|||
return self | |||
|
|||
def __reduce__(self): | |||
return type(self).__new__, (type(self), self.x, self.y) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will that prevent subclasses (esp. ones that add attributes) to be pickled correctly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The improved test answers this positively, in the case of subclasses without extra attributes.
I guess it would make sense to punt the with-attributes case to #144.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pickle docs mention higher-level protocols, but they're not actually implemented by the core stuff? not super clear.
Co-Authored-By: astronouth7303 <jamie@ivyleav.es>
bors r+ |
Build succeeded
|
Add support for pickling.