Skip to content

Commit 58fbf7b

Browse files
committed
move entries; some rewording
1 parent e8c368e commit 58fbf7b

File tree

2 files changed

+18
-22
lines changed

2 files changed

+18
-22
lines changed

Doc/library/enum.rst

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ are not normal Python classes. See
6464
Module Contents
6565
---------------
6666

67-
:class:`EnumDict`
68-
69-
A subclass of :class:`dict` that tracks order and enforces unique member names.
70-
7167
:class:`EnumType`
7268

7369
The ``type`` for Enum and its subclasses.
@@ -153,32 +149,21 @@ Module Contents
153149

154150
Return a list of all power-of-two integers contained in a flag.
155151

152+
:class:`EnumDict`
153+
154+
A subclass of :class:`dict` for use when subclassing :class:`EnumType`.
155+
156156

157157
.. versionadded:: 3.6 ``Flag``, ``IntFlag``, ``auto``
158158
.. versionadded:: 3.11 ``StrEnum``, ``EnumCheck``, ``ReprEnum``, ``FlagBoundary``, ``property``, ``member``, ``nonmember``, ``global_enum``, ``show_flag_values``
159+
.. versionadded:: 3.14 ``EnumDict``
159160

160161
---------------
161162

162163
Data Types
163164
----------
164165

165166

166-
.. class:: EnumDict
167-
168-
*EnumDict* is a subclass of :class:`dict` that keeps track of the order of enum members and prevents reusing member names. Use *EnumDict* when member names must be unique and their order needs to be preserved.
169-
170-
.. attribute:: EnumDict.member_names
171-
172-
Return list of member names.
173-
174-
.. method:: EnumDict.__setitem__(self, key, value)
175-
176-
Set any item as an enum member that is not dundered and not a descriptor.
177-
178-
.. method:: EnumDict.update(self, members, **more_members)
179-
180-
Update the dictionary from the given iterable or dictionary members and more_members.
181-
182167
.. class:: EnumType
183168

184169
*EnumType* is the :term:`metaclass` for *enum* enumerations. It is possible
@@ -839,7 +824,17 @@ Data Types
839824
>>> KeepFlag(2**2 + 2**4)
840825
<KeepFlag.BLUE|16: 20>
841826

842-
.. versionadded:: 3.11
827+
.. versionadded:: 3.11
828+
829+
.. class:: EnumDict
830+
831+
*EnumDict* is a subclass of :class:`dict` for use when subclassing :class:`EnumType`.
832+
833+
.. attribute:: EnumDict.member_names
834+
835+
Return list of member names.
836+
837+
.. versionadded:: 3.14
843838

844839
---------------
845840

Doc/whatsnew/3.13.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,8 @@ email
745745
enum
746746
----
747747

748-
* :class:`~enum.EnumDict` has been made public in :mod:`enum`.
748+
* :class:`~enum.EnumDict` has been made public in :mod:`enum` to better support
749+
subclassing :class:`~enum.EnumType`.
749750

750751
fractions
751752
---------

0 commit comments

Comments
 (0)