[3.12] gh-104271: Fix auto() fallback in case of mixed type Enum#104279
[3.12] gh-104271: Fix auto() fallback in case of mixed type Enum#104279ethanfurman merged 3 commits intopython:3.12from
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_valuesin 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.