-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-44356: [Enum] allow multiple data-type mixins if they are all the same #26649
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-44356: [Enum] allow multiple data-type mixins if they are all the same #26649
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.10. |
Thanks @ethanfurman for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
GH-26652 is a backport of this pull request to the 3.9 branch. |
… same (pythonGH-26649) This enables, for example, two base Enums to both inherit from `str`, and then both be mixed into the same final Enum: class Str1Enum(str, Enum): GH- some behavior here class Str2Enum(str, Enum): GH- some more behavior here class FinalStrEnum(Str1Enum, Str2Enum): GH- this now works (cherry picked from commit 8a4f085) Co-authored-by: Ethan Furman <[email protected]>
GH-26653 is a backport of this pull request to the 3.10 branch. |
… same (pythonGH-26649) This enables, for example, two base Enums to both inherit from `str`, and then both be mixed into the same final Enum: class Str1Enum(str, Enum): GH- some behavior here class Str2Enum(str, Enum): GH- some more behavior here class FinalStrEnum(Str1Enum, Str2Enum): GH- this now works (cherry picked from commit 8a4f085) Co-authored-by: Ethan Furman <[email protected]>
GH-26654 is a backport of this pull request to the 3.8 branch. |
… same (pythonGH-26649) This enables, for example, two base Enums to both inherit from `str`, and then both be mixed into the same final Enum: class Str1Enum(str, Enum): GH- some behavior here class Str2Enum(str, Enum): GH- some more behavior here class FinalStrEnum(Str1Enum, Str2Enum): GH- this now works (cherry picked from commit 8a4f085) Co-authored-by: Ethan Furman <[email protected]>
… same (GH-26649) (GH-26653) This enables, for example, two base Enums to both inherit from `str`, and then both be mixed into the same final Enum: class Str1Enum(str, Enum): GH- some behavior here class Str2Enum(str, Enum): GH- some more behavior here class FinalStrEnum(Str1Enum, Str2Enum): GH- this now works (cherry picked from commit 8a4f085) Co-authored-by: Ethan Furman <[email protected]> Co-authored-by: Ethan Furman <[email protected]>
… same (GH-26649) (GH-26652) This enables, for example, two base Enums to both inherit from `str`, and then both be mixed into the same final Enum: class Str1Enum(str, Enum): GH- some behavior here class Str2Enum(str, Enum): GH- some more behavior here class FinalStrEnum(Str1Enum, Str2Enum): GH- this now works (cherry picked from commit 8a4f085) Co-authored-by: Ethan Furman <[email protected]> Co-authored-by: Ethan Furman <[email protected]>
https://bugs.python.org/issue44356