]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.11] gh-103479: [Enum] require __new__ to be considered a data type (GH-103495...
authorEthan Furman <ethan@stoneleaf.us>
Thu, 13 Apr 2023 19:04:06 +0000 (12:04 -0700)
committerGitHub <noreply@github.com>
Thu, 13 Apr 2023 19:04:06 +0000 (12:04 -0700)
commit3b929a7b321dae113593d81caf47c4f08890c615
treea63bc071059b47d988a0b97224631de283392211
parent804a973d8e5fd2728aeef268f3e577d2c0b05baa
[3.11] gh-103479: [Enum] require __new__ to be considered a data type (GH-103495) (GH-103514)

a mixin must either have a __new__ method, or be a dataclass, to be interpreted as a data-type; an __init__ method is not enough (restores pre-3.11 behavior for non-dataclasses).

(cherry picked from commit a6f95941a3d686707fb38e0f37758e666f25e180)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Doc/howto/enum.rst
Lib/enum.py
Lib/test/test_enum.py