-
-
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
Enum works in python 3.10 breaks in 3.11 #104271
Comments
I confirmed the issue and proposed a fix in gh-104279 I think iterating the list of in any case, @naringas, it seems that this use of |
I think the issue came from how I use Now that I've had to think about this, I realize expect unique (hence the decorator to error out if this fails) numerical values. I think this is a valid expectation for a unique Enum type with mixed values. question: this issue gets closed if/when the PR gets merged? |
I think so, although it's up to the codeowner (Ethan) to decide if and how this should be fixed |
@ethanfurman what do you think about this issue and proposed fix? |
Apologies for the delay, I'll try to get to this this week. In general I agree with the proposed solution. |
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
Bug report
I have this (simplified) code
I tested this (I developed it) using python 3.10.8.
My friend ran it in 3.11.3 and it breaks like this:
We can work around the problem using a
StrEnum
and it's all fine. But I think this is a regression bug. I don't think my code should break like this because the standard library changed.Also, fyi, StrEnum is new in 3.11 so I cannot just adjust my own code (which works well).
Linked PRs
The text was updated successfully, but these errors were encountered: