From: Ethan Furman Date: Wed, 28 Feb 2024 23:17:20 +0000 (-0800) Subject: [3.12] gh-115821: [Enum] better error message for calling super().__new__() (GH-116065) X-Git-Tag: v3.12.3~186 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=83ff92d225816bc23073e9d5a57cc117a4f25714;p=thirdparty%2FPython%2Fcpython.git [3.12] gh-115821: [Enum] better error message for calling super().__new__() (GH-116065) Add note to not call super().__new__() in docs. --- diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst index 4719c462a49c..a03961b9a1eb 100644 --- a/Doc/library/enum.rst +++ b/Doc/library/enum.rst @@ -390,6 +390,9 @@ Data Types results in the call ``int('1a', 16)`` and a value of ``17`` for the member. + ..note:: When writing a custom ``__new__``, do not use ``super().__new__`` -- + call the appropriate ``__new__`` instead. + .. method:: Enum.__repr__(self) Returns the string used for *repr()* calls. By default, returns the