@@ -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
@@ -424,9 +424,9 @@ Data Types
424
424
Using :class: `auto ` with :class: `IntEnum ` results in integers of increasing
425
425
value, starting with ``1 ``.
426
426
427
- .. versionchanged :: 3.11 :meth:`__str__` is now :func:` int.__str__` to
427
+ .. versionchanged :: 3.11 :meth:`~object. __str__` is now :meth:`! int.__str__` to
428
428
better support the *replacement of existing constants * use-case.
429
- :meth: `__format__ ` was already :func: ` int.__format__ ` for that same reason.
429
+ :meth: `~object. __format__ ` was already :meth: ` ! int.__format__ ` for that same reason.
430
430
431
431
432
432
.. class :: StrEnum
@@ -761,11 +761,11 @@ Data Types
761
761
Supported ``__dunder__ `` names
762
762
""""""""""""""""""""""""""""""
763
763
764
- :attr: `__members__ ` is a read-only ordered mapping of ``member_name ``:``member ``
764
+ :attr: `~EnumType. __members__ ` is a read-only ordered mapping of ``member_name ``:``member ``
765
765
items. It is only available on the class.
766
766
767
- :meth: `__new__ `, if specified, must create and return the enum members; it is
768
- also a very good idea to set the member's :attr: `_value_ ` appropriately. Once
767
+ :meth: `~object. __new__ `, if specified, must create and return the enum members; it is
768
+ also a very good idea to set the member's :attr: `! _value_ ` appropriately. Once
769
769
all the members are created it is no longer used.
770
770
771
771
@@ -804,7 +804,7 @@ Utilities and Decorators
804
804
.. class :: auto
805
805
806
806
*auto * can be used in place of a value. If used, the *Enum * machinery will
807
- call an *Enum *'s :meth: `_generate_next_value_ ` to get an appropriate value.
807
+ call an *Enum *'s :meth: `~Enum. _generate_next_value_ ` to get an appropriate value.
808
808
For *Enum * and *IntEnum * that appropriate value will be the last value plus
809
809
one; for *Flag * and *IntFlag * it will be the first power-of-two greater
810
810
than the highest value; for *StrEnum * it will be the lower-cased version of
@@ -847,7 +847,7 @@ Utilities and Decorators
847
847
.. decorator :: unique
848
848
849
849
A :keyword: `class ` decorator specifically for enumerations. It searches an
850
- enumeration's :attr: `__members__ `, gathering any aliases it finds; if any are
850
+ enumeration's :attr: `~EnumType. __members__ `, gathering any aliases it finds; if any are
851
851
found :exc: `ValueError ` is raised with the details::
852
852
853
853
>>> from enum import Enum, unique
0 commit comments