@@ -52,11 +52,11 @@ are not normal Python classes. See
52
52
53
53
.. note :: Nomenclature
54
54
55
- - The class :class: `Color ` is an *enumeration * (or *enum *)
56
- - The attributes :attr: `Color.RED `, :attr: `Color.GREEN `, etc., are
55
+ - The class :class: `! Color ` is an *enumeration * (or *enum *)
56
+ - The attributes :attr: `! Color.RED `, :attr: `! Color.GREEN `, etc., are
57
57
*enumeration members * (or *members *) and are functionally constants.
58
58
- The enum members have *names * and *values * (the name of
59
- :attr: `Color.RED ` is ``RED ``, the value of :attr: `Color.BLUE ` is
59
+ :attr: `! Color.RED ` is ``RED ``, the value of :attr: `! Color.BLUE ` is
60
60
``3 ``, etc.)
61
61
62
62
---------------
@@ -165,8 +165,8 @@ Data Types
165
165
to subclass *EnumType * -- see :ref: `Subclassing EnumType <enumtype-examples >`
166
166
for details.
167
167
168
- *EnumType * is responsible for setting the correct :meth: `__repr__ `,
169
- :meth: `__str__ `, :meth: `__format__ `, and :meth: `__reduce__ ` methods on the
168
+ *EnumType * is responsible for setting the correct :meth: `! __repr__ `,
169
+ :meth: `! __str__ `, :meth: `! __format__ `, and :meth: `! __reduce__ ` methods on the
170
170
final *enum *, as well as creating the enum members, properly handling
171
171
duplicates, providing iteration over the enum class, etc.
172
172
@@ -422,9 +422,9 @@ Data Types
422
422
Using :class: `auto ` with :class: `IntEnum ` results in integers of increasing
423
423
value, starting with ``1 ``.
424
424
425
- .. versionchanged :: 3.11 :meth:`__str__` is now :func:` int.__str__` to
425
+ .. versionchanged :: 3.11 :meth:`~object. __str__` is now :meth:`! int.__str__` to
426
426
better support the *replacement of existing constants * use-case.
427
- :meth: `__format__ ` was already :func: ` int.__format__ ` for that same reason.
427
+ :meth: `~object. __format__ ` was already :meth: ` ! int.__format__ ` for that same reason.
428
428
429
429
430
430
.. class :: StrEnum
@@ -753,11 +753,11 @@ Data Types
753
753
Supported ``__dunder__ `` names
754
754
""""""""""""""""""""""""""""""
755
755
756
- :attr: `__members__ ` is a read-only ordered mapping of ``member_name ``:``member ``
756
+ :attr: `~EnumType. __members__ ` is a read-only ordered mapping of ``member_name ``:``member ``
757
757
items. It is only available on the class.
758
758
759
- :meth: `__new__ `, if specified, must create and return the enum members; it is
760
- also a very good idea to set the member's :attr: `_value_ ` appropriately. Once
759
+ :meth: `~object. __new__ `, if specified, must create and return the enum members; it is
760
+ also a very good idea to set the member's :attr: `! _value_ ` appropriately. Once
761
761
all the members are created it is no longer used.
762
762
763
763
@@ -796,7 +796,7 @@ Utilities and Decorators
796
796
.. class :: auto
797
797
798
798
*auto * can be used in place of a value. If used, the *Enum * machinery will
799
- call an *Enum *'s :meth: `_generate_next_value_ ` to get an appropriate value.
799
+ call an *Enum *'s :meth: `~Enum. _generate_next_value_ ` to get an appropriate value.
800
800
For *Enum * and *IntEnum * that appropriate value will be the last value plus
801
801
one; for *Flag * and *IntFlag * it will be the first power-of-two greater
802
802
than the highest value; for *StrEnum * it will be the lower-cased version of
@@ -839,7 +839,7 @@ Utilities and Decorators
839
839
.. decorator :: unique
840
840
841
841
A :keyword: `class ` decorator specifically for enumerations. It searches an
842
- enumeration's :attr: `__members__ `, gathering any aliases it finds; if any are
842
+ enumeration's :attr: `~EnumType. __members__ `, gathering any aliases it finds; if any are
843
843
found :exc: `ValueError ` is raised with the details::
844
844
845
845
>>> from enum import Enum, unique
0 commit comments