-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
gh-93820: Pickle enum.Flag by name #93891
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
gh-93820: Pickle enum.Flag by name #93891
Conversation
A Flag instance with multiple members is serialized like this:
It looks like only the first member is reduced by name. |
The rest is reduced recursively.
|
output with |
I think that it is okay. Enums are considered singletons (it allows to pickle them by name). It would be even better to add the This PR is not ideal:
It is a matter of the following optimizations. |
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Sorry, @serhiy-storchaka, I could not cleanly backport this to |
(cherry picked from commit 5369858) Co-authored-by: Serhiy Storchaka <[email protected]>
GH-94288 is a backport of this pull request to the 3.11 branch. |
(cherry picked from commit 5369858) Co-authored-by: Serhiy Storchaka <[email protected]>
#93820.