@@ -165,7 +165,7 @@ 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__ `,
168
+ `` EnumType `` is responsible for setting the correct :meth: `!__repr__ `,
169
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.
@@ -406,7 +406,7 @@ Data Types
406
406
407
407
.. class :: IntEnum
408
408
409
- *IntEnum * is the same as * Enum * , but its members are also integers and can be
409
+ *IntEnum * is the same as :class: ` Enum ` , but its members are also integers and can be
410
410
used anywhere that an integer can be used. If any integer operation is performed
411
411
with an *IntEnum * member, the resulting value loses its enumeration status.
412
412
@@ -437,7 +437,7 @@ Data Types
437
437
438
438
.. class :: StrEnum
439
439
440
- * StrEnum * is the same as * Enum * , but its members are also strings and can be used
440
+ `` StrEnum `` is the same as :class: ` Enum ` , but its members are also strings and can be used
441
441
in most of the same places that a string can be used. The result of any string
442
442
operation performed on or with a *StrEnum * member is not part of the enumeration.
443
443
@@ -576,7 +576,7 @@ Data Types
576
576
577
577
.. class :: IntFlag
578
578
579
- * IntFlag * is the same as * Flag * , but its members are also integers and can be
579
+ `` IntFlag `` is the same as :class: ` Flag ` , but its members are also integers and can be
580
580
used anywhere that an integer can be used.
581
581
582
582
>>> from enum import IntFlag, auto
@@ -596,12 +596,12 @@ Data Types
596
596
>>> Color.RED + 2
597
597
3
598
598
599
- If a * Flag * operation is performed with an *IntFlag * member and:
599
+ If a :class: ` Flag ` operation is performed with an *IntFlag * member and:
600
600
601
601
* the result is a valid *IntFlag *: an *IntFlag * is returned
602
- * the result is not a valid *IntFlag *: the result depends on the * FlagBoundary * setting
602
+ * the result is not a valid *IntFlag *: the result depends on the :class: ` FlagBoundary ` setting
603
603
604
- The * repr() * of unnamed zero-valued flags has changed. It is now:
604
+ The :func: ` repr() ` of unnamed zero-valued flags has changed. It is now:
605
605
606
606
>>> Color(0 )
607
607
<Color: 0>
@@ -697,7 +697,7 @@ Data Types
697
697
698
698
.. class :: FlagBoundary
699
699
700
- * FlagBoundary * controls how out-of-range values are handled in * Flag * and its
700
+ `` FlagBoundary `` controls how out-of-range values are handled in :class: ` Flag ` and its
701
701
subclasses.
702
702
703
703
.. attribute :: STRICT
@@ -720,7 +720,7 @@ Data Types
720
720
721
721
.. attribute :: CONFORM
722
722
723
- Out-of-range values have invalid values removed, leaving a valid * Flag *
723
+ Out-of-range values have invalid values removed, leaving a valid :class: ` Flag `
724
724
value::
725
725
726
726
>>> from enum import Flag, CONFORM, auto
@@ -734,7 +734,7 @@ Data Types
734
734
735
735
.. attribute :: EJECT
736
736
737
- Out-of-range values lose their * Flag * membership and revert to :class: `int `.
737
+ Out-of-range values lose their :class: ` Flag ` membership and revert to :class: `int `.
738
738
739
739
>>> from enum import Flag, EJECT , auto
740
740
>>> class EjectFlag (Flag , boundary = EJECT ):
@@ -747,7 +747,7 @@ Data Types
747
747
748
748
.. attribute :: KEEP
749
749
750
- Out-of-range values are kept, and the * Flag * membership is kept.
750
+ Out-of-range values are kept, and the :class: ` Flag ` membership is kept.
751
751
This is the default for :class: `IntFlag `::
752
752
753
753
>>> from enum import Flag, KEEP, auto
@@ -809,10 +809,10 @@ Utilities and Decorators
809
809
.. class :: auto
810
810
811
811
*auto * can be used in place of a value. If used, the *Enum * machinery will
812
- call an * Enum * 's :meth: `~Enum._generate_next_value_ ` to get an appropriate value.
813
- For * Enum * and * IntEnum * that appropriate value will be the last value plus
814
- one; for * Flag * and * IntFlag * it will be the first power-of-two greater
815
- than the highest value; for * StrEnum * it will be the lower-cased version of
812
+ call an :class: ` Enum ` 's :meth: `~Enum._generate_next_value_ ` to get an appropriate value.
813
+ For :class: ` Enum ` and :class: ` IntEnum ` that appropriate value will be the last value plus
814
+ one; for :class: ` Flag ` and :class: ` IntFlag ` it will be the first power-of-two greater
815
+ than the highest value; for :class: ` StrEnum ` it will be the lower-cased version of
816
816
the member's name. Care must be taken if mixing *auto() * with manually
817
817
specified values.
818
818
0 commit comments