]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-41789: honor object overrides in Enum classes (GH-22250)
authorEthan Furman <ethan@stoneleaf.us>
Tue, 15 Sep 2020 23:28:25 +0000 (16:28 -0700)
committerGitHub <noreply@github.com>
Tue, 15 Sep 2020 23:28:25 +0000 (16:28 -0700)
commit22415ad62555d79bd583b4a7d6a96006624a8277
treed85eb13c71814c8169749ef10581bb98d9b678b5
parent47f6ec4c09a138e9049fd245ca312842ff50ce42
bpo-41789: honor object overrides in Enum classes (GH-22250)

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.

Automerge-Triggered-By: @ethanfurman
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]