diff options
author | Jelle Zijlstra <jelle.zijlstra@gmail.com> | 2024-04-26 23:25:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-26 23:25:31 (GMT) |
commit | 186fbe82f7b3124835bcd3cfc4a03139ea8ba034 (patch) | |
tree | 3604a05cbfa9a09322d4633e998b3ffd3893060c /Doc/library | |
parent | ef12d239faeaca55d65702d04d8fa4cb4b4e52c7 (diff) | |
download | cpython-186fbe82f7b3124835bcd3cfc4a03139ea8ba034.zip cpython-186fbe82f7b3124835bcd3cfc4a03139ea8ba034.tar.gz cpython-186fbe82f7b3124835bcd3cfc4a03139ea8ba034.tar.bz2 |
[3.12] Fix note in Enum.__new__ docs (GH-118284) (#118325)
(cherry picked from commit 5a4d3df2fa02409ffd2a90cd75b67370206e9891)
Co-authored-by: Philipp A <flying-sheep@web.de>
Diffstat (limited to 'Doc/library')
-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 bc5b3d7..faeb94d 100644 --- a/Doc/library/enum.rst +++ b/Doc/library/enum.rst @@ -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 @@ -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_ @@ -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) @@ -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. |