File tree 2 files changed +24
-1
lines changed
2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,10 @@ are not normal Python classes. See
64
64
Module Contents
65
65
---------------
66
66
67
+ :class: `EnumDict `
68
+
69
+ An enum class :class: `dict ` that tracks order and enforces unique member names.
70
+
67
71
:class: `EnumType `
68
72
69
73
The ``type `` for Enum and its subclasses.
@@ -159,7 +163,21 @@ Data Types
159
163
----------
160
164
161
165
162
- .. class :: EnumType
166
+ .. class :: EnumDict
167
+
168
+ *EnumDict * is used by *EnumType * to keep track of the enum member orders and prevent reusing the member names.
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.
163
181
164
182
*EnumType * is the :term: `metaclass ` for *enum * enumerations. It is possible
165
183
to subclass *EnumType * -- see :ref: `Subclassing EnumType <enumtype-examples >`
Original file line number Diff line number Diff line change @@ -742,6 +742,11 @@ email
742
742
(Contributed by Thomas Dwyer and Victor Stinner for :gh: `102988 ` to improve
743
743
the :cve: `2023-27043 ` fix.)
744
744
745
+ enum
746
+ ----
747
+
748
+ * :class: `~enum.EnumDict ` has been made public in :mod: `enum `.
749
+
745
750
fractions
746
751
---------
747
752
You can’t perform that action at this time.
0 commit comments