GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [3.12] gh-104271: Fix auto() fallback in case of mixed type Enum by itamaro · Pull Request #104279 · python/cpython

Conversation

@itamaro

@itamaro itamaro commented May 7, 2023 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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 first auto(), as demonstrated in the test case I extended in this PR.

  • Issue: Enum works in python 3.10 breaks in 3.11 #104271

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@itamaro
pythongh-104271: Fix auto() fallback in case of mixed type Enum
09bfba4
@itamaro
itamaro requested a review from ethanfurman as a code owner May 7, 2023 21:16
@bedevere-bot bedevere-bot mentioned this pull request May 7, 2023
Enum works in python 3.10 breaks in 3.11 #104271
Closed
@bedevere-bot bedevere-bot added the awaiting review label May 7, 2023
@ethanfurman ethanfurman self-assigned this May 23, 2023
@ethanfurman ethanfurman added stdlib Standard Library Python modules in the Lib/ directory 3.11 only security fixes 3.12 only security fixes needs backport to 3.11 only security fixes labels May 23, 2023
@ethanfurman ethanfurman changed the title gh-104271: Fix auto() fallback in case of mixed type Enum [3.12] gh-104271: Fix auto() fallback in case of mixed type Enum May 23, 2023
@ethanfurman
ethanfurman changed the base branch from main to 3.12 May 23, 2023 01:02
ethanfurman
ethanfurman approved these changes May 23, 2023
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting review labels May 23, 2023
@ethanfurman ethanfurman added the skip news label May 23, 2023
@ethanfurman ethanfurman closed this May 23, 2023
@ethanfurman ethanfurman reopened this May 23, 2023
ethanfurman added 2 commits May 22, 2023 19:40
@ethanfurman
Merge branch '3.12' into pythongh-104271
0f0de17
@ethanfurman
Merge branch '3.12' into pythongh-104271
fa2ea05
@ethanfurman
ethanfurman merged commit f4e2049 into python:3.12 May 23, 2023
@miss-islington

miss-islington commented May 23, 2023

Copy link
Copy Markdown
Contributor

Thanks @itamaro for the PR, and @ethanfurman for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the awaiting merge label May 23, 2023
@miss-islington

miss-islington commented May 23, 2023

Copy link
Copy Markdown
Contributor

Sorry @itamaro and @ethanfurman, I had trouble checking out the 3.11 backport branch.
Please retry by removing and re-adding the "needs backport to 3.11" label.
Alternatively, you can backport using cherry_picker on the command line.
cherry_picker f4e2049f14d40c1b893c68530eec5e341cf3d929 3.11

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@itamaro

itamaro commented May 23, 2023

Copy link
Copy Markdown
Contributor Author

@ethanfurman how do we port it also to main branch now? should it be a new PR for main?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ethanfurman

ethanfurman commented May 23, 2023

Copy link
Copy Markdown
Member

It doesn't need to go in main (which is now 3.13) because mixed types are no longer supported by the default _generate_next_value_().

itamaro reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ethanfurman ethanfurman added needs backport to 3.11 only security fixes and removed needs backport to 3.11 only security fixes labels May 23, 2023
@miss-islington

miss-islington commented May 23, 2023

Copy link
Copy Markdown
Contributor

Thanks @itamaro for the PR, and @ethanfurman for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot

bedevere-bot commented May 23, 2023

Copy link
Copy Markdown

GH-104809 is a backport of this pull request to the 3.11 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label May 23, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 23, 2023
@itamaro @miss-islington
[3.12] pythongh-104271: Fix auto() fallback in case of mixed type Enum (
10939d3
pythonGH-104279)

(cherry picked from commit f4e2049)

Co-authored-by: Itamar Ostricher <[email protected]>
pythongh-104271: Fix auto() fallback in case of mixed type Enum
ethanfurman pushed a commit that referenced this pull request May 23, 2023
@miss-islington @itamaro
[3.11] gh-104271: Fix auto() fallback in case of mixed type Enum (GH-…
582aadc
…104809)

[3.12] gh-104271: Fix auto() fallback in case of mixed type Enum (GH-104279)
(cherry picked from commit f4e2049)

Co-authored-by: Itamar Ostricher <[email protected]>
@erlend-aasland erlend-aasland mentioned this pull request Jun 6, 2023
3.12 backport gh 105236 #105358
Closed
@itamaro
itamaro deleted the gh-104271 branch April 9, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ethanfurman ethanfurman ethanfurman approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@ethanfurman ethanfurman

Labels

3.11 only security fixes 3.12 only security fixes skip news stdlib Standard Library Python modules in the Lib/ directory

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@itamaro @miss-islington @ethanfurman @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.