diff options
author | Ethan Furman <ethan@stoneleaf.us> | 2020-09-16 10:58:33 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-16 10:58:33 (GMT) |
commit | a4677068dd61662f5a56b184d5e3aa07db65b88e (patch) | |
tree | 481499cebd1e1e8a301673d04d15dc08581e933b /Misc | |
parent | 95b81e2f8c955823dbf5632a817902b8a4916eaa (diff) | |
download | cpython-a4677068dd61662f5a56b184d5e3aa07db65b88e.zip cpython-a4677068dd61662f5a56b184d5e3aa07db65b88e.tar.gz cpython-a4677068dd61662f5a56b184d5e3aa07db65b88e.tar.bz2 |
[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.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/Library/2020-09-14-19-27-46.bpo-41789.pI_uZQ.rst | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2020-09-14-19-27-46.bpo-41789.pI_uZQ.rst b/Misc/NEWS.d/next/Library/2020-09-14-19-27-46.bpo-41789.pI_uZQ.rst new file mode 100644 index 0000000..5ce7a3c --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-09-14-19-27-46.bpo-41789.pI_uZQ.rst @@ -0,0 +1,2 @@ +Honor `object` overrides in `Enum` class creation (specifically, `__str__`, +`__repr__`, `__format__`, and `__reduce_ex__`). |