bpo-44559: [Enum] restore fixes lost in 3.9 reversion (GH-29114)
- fix exception leaks
- re-add deprecation warnings
diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst
index e8e4942..b354a11 100644
--- a/Doc/library/enum.rst
+++ b/Doc/library/enum.rst
@@ -1125,9 +1125,9 @@
_Private__names
"""""""""""""""
-Private names will be normal attributes in Python 3.10 instead of either an error
+Private names will be normal attributes in Python 3.11 instead of either an error
or a member (depending on if the name ends with an underscore). Using these names
-in 3.9 will issue a :exc:`DeprecationWarning`.
+in 3.10 will issue a :exc:`DeprecationWarning`.
``Enum`` member type
@@ -1150,6 +1150,10 @@
>>> FieldTypes.size.value
2
+.. note::
+
+ This behavior is deprecated and will be removed in 3.12.
+
.. versionchanged:: 3.5
@@ -1200,3 +1204,9 @@
>>> Color(7) # not named combination
<Color.CYAN|MAGENTA|BLUE|YELLOW|GREEN|RED: 7>
+.. note::
+
+ In 3.11 unnamed combinations of flags will only produce the canonical flag
+ members (aka single-value flags). So ``Color(7)`` will produce something
+ like ``<Color.BLUE|GREEN|RED: 7>``.
+