bpo-42567: [Enum] call __init_subclass__ after members are added#23714
Merged
Conversation
Contributor
|
Thanks @ethanfurman for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9. |
Contributor
|
Thanks @ethanfurman for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9. |
1 similar comment
Contributor
|
Thanks @ethanfurman for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9. |
Contributor
|
Sorry, @ethanfurman, I could not cleanly backport this to |
Contributor
|
Sorry @ethanfurman, I had trouble checking out the |
ethanfurman
added a commit
to ethanfurman/cpython
that referenced
this pull request
Dec 15, 2020
pythonGH-23714) When creating an Enum, type.__new__ calls __init_subclass__, but at that point the members have not been added. This patch suppresses the initial call, then manually calls the ancestor __init_subclass__ before returning the new Enum class.. (cherry picked from commit 6bd94de) Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
|
GH-23772 is a backport of this pull request to the 3.9 branch. |
ethanfurman
added a commit
that referenced
this pull request
Dec 15, 2020
GH-23714) (GH-23772) When creating an Enum, `type.__new__` calls `__init_subclass__`, but at that point the members have not been added. This patch suppresses the initial call, then manually calls the ancestor `__init_subclass__` before returning the new Enum class. (cherry picked from commit 6bd94de)
adorilson
pushed a commit
to adorilson/cpython
that referenced
this pull request
Mar 13, 2021
…honGH-23714) When creating an Enum, type.__new__ calls __init_subclass__, but at that point the members have not been added. This patch suppresses the initial call, then manually calls the ancestor __init_subclass__ before returning the new Enum class.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When creating an Enum,
type.__new__calls__init_subclass__, but at that point the members have not been added.This patch suppresses the initial call, then manually calls the ancestor
__init_subclass__before returning the new Enum class.https://bugs.python.org/issue42567