Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[3.9] bpo-44356: [Enum] allow multiple data-type mixins if they are all the same (GH-26649) #26652

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

Merged
merged 1 commit into from
Jun 10, 2021

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Jun 10, 2021

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]

https://bugs.python.org/issue44356

… 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]>
@miss-islington
Copy link
Contributor Author

@ethanfurman: Status check is done, and it's a success ✅ .

@ethanfurman ethanfurman merged commit 304ec53 into python:3.9 Jun 10, 2021
@miss-islington miss-islington deleted the backport-8a4f085-3.9 branch June 10, 2021 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants