]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.9] bpo-41789: honor object overrides in Enum classes (GH-22250) (GH-22272)
authorEthan Furman <ethan@stoneleaf.us>
Wed, 16 Sep 2020 10:58:33 +0000 (03:58 -0700)
committerGitHub <noreply@github.com>
Wed, 16 Sep 2020 10:58:33 +0000 (03:58 -0700)
commita4677068dd61662f5a56b184d5e3aa07db65b88e
tree481499cebd1e1e8a301673d04d15dc08581e933b
parent95b81e2f8c955823dbf5632a817902b8a4916eaa
[3.9] bpo-41789: honor object overrides in Enum classes (GH-22250) (GH-22272)

EnumMeta double-checks that `__repr__`, `__str__`, `__format__`, and `__reduce_ex__` are not the same as `object`'s, and replaces them if they are -- even if that replacement was intentionally done in the Enum being constructed.  This patch fixes that.
Lib/enum.py
Lib/test/test_enum.py
Misc/NEWS.d/next/Library/2020-09-14-19-27-46.bpo-41789.pI_uZQ.rst [new file with mode: 0644]