-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
[3.12] gh-104271: Fix auto() fallback in case of mixed type Enum #104279
Conversation
Thanks @itamaro for the PR, and @ethanfurman for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Sorry @itamaro and @ethanfurman, I had trouble checking out the |
@ethanfurman how do we port it also to main branch now? should it be a new PR for main? |
It doesn't need to go in main (which is now 3.13) because mixed types are no longer supported by the default |
Thanks @itamaro for the PR, and @ethanfurman for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
GH-104809 is a backport of this pull request to the 3.11 branch. |
pythonGH-104279) (cherry picked from commit f4e2049) Co-authored-by: Itamar Ostricher <itamarost@gmail.com> pythongh-104271: Fix auto() fallback in case of mixed type Enum
gh-91457 changed the behavior of
auto()
in case of mixed type Enums.the fallback behavior (before deprecation) was supposed to be backwards compatible (I think), but iterating the sorted
last_values
in order (instead of reversed order) results an incorrect behavior of always reusing values after the firstauto()
, as demonstrated in the test case I extended in this PR.