]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-44356: [Enum] allow multiple data-type mixins if they are all the same (GH-26649)
authorEthan Furman <ethan@stoneleaf.us>
Thu, 10 Jun 2021 20:30:41 +0000 (13:30 -0700)
committerGitHub <noreply@github.com>
Thu, 10 Jun 2021 20:30:41 +0000 (13:30 -0700)
commit8a4f0850d75747af8c96ca0e7eef1f5c1abfba25
treefde4b0f4a03765b96b3af92818fad1fe00d12b39
parent42d5a4fc3b35e45cdd237d56a04e98894d0a31f5
bpo-44356: [Enum] allow multiple data-type mixins if they are all the same (GH-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):
        # some behavior here

    class Str2Enum(str, Enum):
        # some more behavior here

    class FinalStrEnum(Str1Enum, Str2Enum):
        # this now works
Lib/enum.py
Lib/test/test_enum.py
Misc/NEWS.d/next/Library/2021-06-10-08-35-38.bpo-44356.6oDFhO.rst [new file with mode: 0644]