Skip to content

Commit 706ad60

Browse files
committed
Move "Finer Points" in Enum HOWTO one level out
Before this change, the section "Finer Points" was a subsection of "When to use __new__() vs. __init__()" which does not make much sense. This change moves "Finer Points" one level out making it a top level section. All its subsections are moved as well.
1 parent 3b57460 commit 706ad60

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Doc/howto/enum.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -965,16 +965,16 @@ want one of them to be the value::
965965

966966

967967
Finer Points
968-
^^^^^^^^^^^^
968+
------------
969969

970970
Supported ``__dunder__`` and ``_sunder_`` names
971-
"""""""""""""""""""""""""""""""""""""""""""""""
971+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
972972

973973
The supported ``__dunder__`` and ``_sunder_`` names can be found in the :ref:`Enum API documentation <enum-dunder-sunder>`.
974974

975975

976976
_Private__names
977-
"""""""""""""""
977+
^^^^^^^^^^^^^^^
978978

979979
:ref:`Private names <private-name-mangling>` are not converted to enum members,
980980
but remain normal attributes.
@@ -983,7 +983,7 @@ but remain normal attributes.
983983

984984

985985
``Enum`` member type
986-
""""""""""""""""""""
986+
^^^^^^^^^^^^^^^^^^^^
987987

988988
Enum members are instances of their enum class, and are normally accessed as
989989
``EnumClass.member``. In certain situations, such as writing custom enum
@@ -996,7 +996,7 @@ recommended.
996996

997997

998998
Creating members that are mixed with other data types
999-
"""""""""""""""""""""""""""""""""""""""""""""""""""""
999+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10001000

10011001
When subclassing other data types, such as :class:`int` or :class:`str`, with
10021002
an :class:`Enum`, all values after the ``=`` are passed to that data type's
@@ -1010,7 +1010,7 @@ constructor. For example::
10101010

10111011

10121012
Boolean value of ``Enum`` classes and members
1013-
"""""""""""""""""""""""""""""""""""""""""""""
1013+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10141014

10151015
Enum classes that are mixed with non-:class:`Enum` types (such as
10161016
:class:`int`, :class:`str`, etc.) are evaluated according to the mixed-in
@@ -1025,7 +1025,7 @@ Plain :class:`Enum` classes always evaluate as :data:`True`.
10251025

10261026

10271027
``Enum`` classes with methods
1028-
"""""""""""""""""""""""""""""
1028+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10291029

10301030
If you give your enum subclass extra methods, like the `Planet`_
10311031
class below, those methods will show up in a :func:`dir` of the member,
@@ -1038,7 +1038,7 @@ but not of the class::
10381038

10391039

10401040
Combining members of ``Flag``
1041-
"""""""""""""""""""""""""""""
1041+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10421042

10431043
Iterating over a combination of :class:`Flag` members will only return the members that
10441044
are comprised of a single bit::
@@ -1058,7 +1058,7 @@ are comprised of a single bit::
10581058

10591059

10601060
``Flag`` and ``IntFlag`` minutia
1061-
""""""""""""""""""""""""""""""""
1061+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10621062

10631063
Using the following snippet for our examples::
10641064

0 commit comments

Comments
 (0)