Skip to content

[3.12] Fix note in Enum.__new__ docs (GH-118284) #118325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Doc/library/enum.rst
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ Data Types
>>> Color.RED.value
1

Value of the member, can be set in :meth:`~object.__new__`.
Value of the member, can be set in :meth:`~Enum.__new__`.

.. note:: Enum member values

Expand All @@ -289,7 +289,7 @@ Data Types

.. attribute:: Enum._value_

Value of the member, can be set in :meth:`~object.__new__`.
Value of the member, can be set in :meth:`~Enum.__new__`.

.. attribute:: Enum._order_

Expand Down Expand Up @@ -397,8 +397,8 @@ 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.
.. note:: When writing a custom ``__new__``, do not use ``super().__new__`` --
call the appropriate ``__new__`` instead.

.. method:: Enum.__repr__(self)

Expand Down Expand Up @@ -817,7 +817,7 @@ Supported ``__dunder__`` names
:attr:`~EnumType.__members__` is a read-only ordered mapping of ``member_name``:``member``
items. It is only available on the class.

:meth:`~object.__new__`, if specified, must create and return the enum members; it is
:meth:`~Enum.__new__`, if specified, must create and return the enum members; it is
also a very good idea to set the member's :attr:`!_value_` appropriately. Once
all the members are created it is no longer used.

Expand Down
Loading