Skip to content

Commit

Permalink
[3.12] gh-115821: [Enum] better error message for calling super().__n…
Browse files Browse the repository at this point in the history
…ew__() (GH-116065)

Add note to not call super().__new__() in docs.
  • Loading branch information
ethanfurman authored Feb 28, 2024
1 parent a85e512 commit 83ff92d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Doc/library/enum.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 83ff92d

Please sign in to comment.