-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
gh-109022: [Enum] require names=()
to create empty enum type
#109048
Conversation
add guard so that ``Enum('bar')`` raises a ValueError instead of creating a new enum class called `bar`. To create the new but empty class, use: huh = Enum('bar', names=())
names=()
to create empty enum typenames=()
to create empty enum type
🤖 New build scheduled with the buildbot fleet by @ethanfurman for commit d7a9f2f 🤖 If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
Thanks @ethanfurman for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
Sorry, @ethanfurman, I could not cleanly backport this to |
…ythonGH-109048) add guard so that ``Enum('bar')`` raises a TypeError instead of creating a new enum class called `bar`. To create the new but empty class, use: huh = Enum('bar', names=()) (cherry picked from commit c74e440) Co-authored-by: Ethan Furman <[email protected]>
GH-109122 is a backport of this pull request to the 3.12 branch. |
…GH-109048) (#109122) gh-109022: [Enum] require `names=()` to create empty enum type (GH-109048) add guard so that ``Enum('bar')`` raises a TypeError instead of creating a new enum class called `bar`. To create the new but empty class, use: huh = Enum('bar', names=()) (cherry picked from commit c74e440) Co-authored-by: Ethan Furman <[email protected]>
add guard so that
Enum('bar')
raises a ValueError instead of creating a new enum class calledbar
. To create the new but empty class, use:ValueError
#109022