diff options
author | Philipp A <flying-sheep@web.de> | 2024-04-26 14:06:53 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-26 14:06:53 (GMT) |
commit | 5a4d3df2fa02409ffd2a90cd75b67370206e9891 (patch) | |
tree | bf553ab16ceb5fee34cee79cc8b1cff4ddc618aa | |
parent | 463c20dae9ac91d6c44028177b90f43238b819cf (diff) | |
download | cpython-5a4d3df2fa02409ffd2a90cd75b67370206e9891.zip cpython-5a4d3df2fa02409ffd2a90cd75b67370206e9891.tar.gz cpython-5a4d3df2fa02409ffd2a90cd75b67370206e9891.tar.bz2 |
Fix note in Enum.__new__ docs (#118284)
-rw-r--r-- | Doc/library/enum.rst | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst index d84d9d9..00f617e 100644 --- a/Doc/library/enum.rst +++ b/Doc/library/enum.rst @@ -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_ @@ -407,8 +407,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) @@ -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. |