]> 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...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 10 Jun 2021 22:03:29 +0000 (15:03 -0700)
committerGitHub <noreply@github.com>
Thu, 10 Jun 2021 22:03:29 +0000 (15:03 -0700)
commit304ec53b53021ceddf62a38e66a06aed37e2ac41
tree894178ac2292e47d930d55708ba7802742e3bce2
parent175ebc60d52f2e88cf5cba5224c15074d2623c10
bpo-44356: [Enum] allow multiple data-type mixins if they are all the 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 8a4f0850d75747af8c96ca0e7eef1f5c1abfba25)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
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]