-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
bpo-44676: Serialize the union type using only public API #27323
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
Conversation
|
Should we also remove |
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.
Should we also remove Union._from_args classmethod introduced by #27244? Basically, it was introduced for pickling support so looks like we don't need it anymore.
Agreed. Lets remove it.
Note: we can only remove it if we're backporting this to 3.10. Pickle docs says its confirmed to be backwards compatible. So if we don't backport this, we have to leave the private method in forever :(. Either that, or we can remove serialization from 3.10, I created a PR at GH-27335 for that.
If Serhiy agrees to backporting this, we should probably consult the RM Pablo again.
|
|
||
| pickle(complex, pickle_complex, complex) | ||
|
|
||
| def pickle_union(obj): |
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.
Off topic: I didn't know such a module existed 😮 . This is really cool! Thanks for teaching me something new today Serhiy.
|
Copied over from GH-27244, by Yurii:
I agree with Yurii's reasoning here. +1 to backport this to 3.10 to remove Alternatively, we can remove the ability to pickle Union in 3.10 (see GH-27333). |
|
Oh, I did not know this feature was backported to 3.10. It makes sense to haste and backport this PR too. |
|
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
|
GH-27340 is a backport of this pull request to the 3.10 branch. |
https://bugs.python.org/issue44676