Skip to content

Commit 186fbe8

Browse files
[3.12] Fix note in Enum.__new__ docs (GH-118284) (#118325)
(cherry picked from commit 5a4d3df) Co-authored-by: Philipp A <[email protected]>
1 parent ef12d23 commit 186fbe8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Doc/library/enum.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ Data Types
269269
>>> Color.RED.value
270270
1
271271

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

274274
.. note:: Enum member values
275275

@@ -289,7 +289,7 @@ Data Types
289289

290290
.. attribute:: Enum._value_
291291

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

294294
.. attribute:: Enum._order_
295295

@@ -397,8 +397,8 @@ Data Types
397397

398398
results in the call ``int('1a', 16)`` and a value of ``17`` for the member.
399399

400-
..note:: When writing a custom ``__new__``, do not use ``super().__new__`` --
401-
call the appropriate ``__new__`` instead.
400+
.. note:: When writing a custom ``__new__``, do not use ``super().__new__`` --
401+
call the appropriate ``__new__`` instead.
402402

403403
.. method:: Enum.__repr__(self)
404404

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

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

0 commit comments

Comments
 (0)