-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
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
bpo-42567: [Enum] call __init_subclass__ after members are added #23714
Conversation
Thanks @ethanfurman for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9. |
Thanks @ethanfurman for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9. |
1 similar comment
Thanks @ethanfurman for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9. |
Sorry, @ethanfurman, I could not cleanly backport this to |
Sorry @ethanfurman, I had trouble checking out the |
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. |
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)
…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.
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