summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMd Rokibul Islam <rafi.promit@gmail.com>2024-12-19 23:38:42 (GMT)
committerGitHub <noreply@github.com>2024-12-19 23:38:42 (GMT)
commit39e69a7cd54d44c9061db89bb15c460d30fba7a6 (patch)
treef7ed75710d35b9f21275ee60dbfdfada09cae0bf
parentc14db202750ff9eaf3919298f1172270b7dfd64e (diff)
downloadcpython-39e69a7cd54d44c9061db89bb15c460d30fba7a6.zip
cpython-39e69a7cd54d44c9061db89bb15c460d30fba7a6.tar.gz
cpython-39e69a7cd54d44c9061db89bb15c460d30fba7a6.tar.bz2
gh-112328: Document EnumDict in docs and release notes (GH-121720)
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua> Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
-rw-r--r--Doc/library/enum.rst17
-rw-r--r--Doc/whatsnew/3.13.rst5
2 files changed, 21 insertions, 1 deletions
diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst
index 16a9b03..51292a1 100644
--- a/Doc/library/enum.rst
+++ b/Doc/library/enum.rst
@@ -149,9 +149,14 @@ Module Contents
Return a list of all power-of-two integers contained in a flag.
+ :class:`EnumDict`
+
+ A subclass of :class:`dict` for use when subclassing :class:`EnumType`.
+
.. versionadded:: 3.6 ``Flag``, ``IntFlag``, ``auto``
.. versionadded:: 3.11 ``StrEnum``, ``EnumCheck``, ``ReprEnum``, ``FlagBoundary``, ``property``, ``member``, ``nonmember``, ``global_enum``, ``show_flag_values``
+.. versionadded:: 3.14 ``EnumDict``
---------------
@@ -821,7 +826,17 @@ Data Types
>>> KeepFlag(2**2 + 2**4)
<KeepFlag.BLUE|16: 20>
-.. versionadded:: 3.11
+ .. versionadded:: 3.11
+
+.. class:: EnumDict
+
+ *EnumDict* is a subclass of :class:`dict` for use when subclassing :class:`EnumType`.
+
+ .. attribute:: EnumDict.member_names
+
+ Return list of member names.
+
+ .. versionadded:: 3.14
---------------
diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst
index 45cc1b5..a291122 100644
--- a/Doc/whatsnew/3.13.rst
+++ b/Doc/whatsnew/3.13.rst
@@ -879,6 +879,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` to better support
+ subclassing :class:`~enum.EnumType`.
fractions
---------