Skip to content

Commit

Permalink
Document EnumDict in docs and release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
u2rafi committed Jul 14, 2024
1 parent 0a26aa5 commit d00adac
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
20 changes: 19 additions & 1 deletion Doc/library/enum.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ are not normal Python classes. See
Module Contents
---------------

:class:`EnumDict`

An enum class :class:`dict` that tracks order and enforces unique member names.

:class:`EnumType`

Check warning on line 71 in Doc/library/enum.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:class reference target not found: EnumType

The ``type`` for Enum and its subclasses.
Expand Down Expand Up @@ -159,7 +163,21 @@ Data Types
----------


.. class:: EnumType
.. class:: EnumDict

*EnumDict* is used by *EnumType* to keep track of the enum member orders and prevent reusing the member names.

.. attribute:: EnumDict.member_names

Return list of member names.

.. method:: EnumDict.__setitem__(self, key, value)

Set any item as an enum member that is not dundered and not a descriptor.

.. method:: EnumDict.update(self, members, **more_members)

Update the dictionary from the given iterable or dictionary members and more_members.

*EnumType* is the :term:`metaclass` for *enum* enumerations. It is possible
to subclass *EnumType* -- see :ref:`Subclassing EnumType <enumtype-examples>`
Expand Down
5 changes: 5 additions & 0 deletions Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,11 @@ email
(Contributed by Thomas Dwyer and Victor Stinner for :gh:`102988` to improve
the :cve:`2023-27043` fix.)

enum
----

* :class:`~enum.EnumDict` has been made public in :mod:`enum`.

fractions
---------

Expand Down

0 comments on commit d00adac

Please sign in to comment.