mirror of
https://github.com/python/cpython.git
synced 2025-11-12 07:02:33 +00:00
Fix note in Enum.__new__ docs (#118284)
This commit is contained in:
parent
463c20dae9
commit
5a4d3df2fa
1 changed files with 5 additions and 5 deletions
|
|
@ -279,7 +279,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
|
||||
|
||||
|
|
@ -299,7 +299,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_
|
||||
|
||||
|
|
@ -827,7 +827,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;
|
||||
: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.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue