-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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 by-value lookup no longer compares hashable argument to unhashable values #125710
Labels
3.13
bugs and security fixes
3.14
new features, bugs and security fixes
needs backport to 3.13
bugs and security fixes
stdlib
Python modules in the Lib dir
type-bug
An unexpected behavior, bug, or error
Comments
alien-valkyrie
added a commit
to alien-valkyrie/freeciv
that referenced
this issue
Oct 18, 2024
This is a workaround for python/cpython#125710 See RM #975 Signed-off-by: Alina Lenk <[email protected]>
ethanfurman
added
stdlib
Python modules in the Lib dir
3.13
bugs and security fixes
3.14
new features, bugs and security fixes
needs backport to 3.13
bugs and security fixes
labels
Oct 19, 2024
alien-valkyrie
added a commit
to freeciv/freeciv
that referenced
this issue
Oct 20, 2024
This is a workaround for python/cpython#125710 Reported by Marko Lindqvist See RM #975 Signed-off-by: Alina Lenk <[email protected]>
alien-valkyrie
added a commit
to freeciv/freeciv
that referenced
this issue
Oct 20, 2024
This is a workaround for python/cpython#125710 Reported by Marko Lindqvist See RM #975 Signed-off-by: Alina Lenk <[email protected]>
ethanfurman
added a commit
that referenced
this issue
Oct 22, 2024
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Oct 22, 2024
…mber values (pythonGH-125735) (cherry picked from commit aaed91c) Co-authored-by: Ethan Furman <[email protected]>
ebonnal
pushed a commit
to ebonnal/cpython
that referenced
this issue
Jan 12, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
3.13
bugs and security fixes
3.14
new features, bugs and security fixes
needs backport to 3.13
bugs and security fixes
stdlib
Python modules in the Lib dir
type-bug
An unexpected behavior, bug, or error
Bug report
Bug description:
When defining enum members with hashable values (e.g.
frozenset
s), it was previously (prior to 3.13) possible to look those members up by passing in unhashable values (e.g.set
s) that compare equal to those original values.This no longer works as of 3.13 (specifically GH-112514), since the unhashable argument is now only compared to unhashable enum values. I haven't been able to find any documentation of this change in the What's New or even the changelog, so I'm assuming it's not entirely intended.
Reproducible example:
Note that in this example (which is based on our use case) there's the obvious user-side fix of
Directions(frozenset(dirs))
, but if there happens to be another hashable-equal-to-unhashable use case outside of (frozen)sets, such a workaround might not exist.CPython versions tested on:
3.13
Operating systems tested on:
Windows
Linked PRs
The text was updated successfully, but these errors were encountered: