https://github.com/python/cpython/commit/e4deefbb2f93bceba6dd5c38152c90d678cd882c
commit: e4deefbb2f93bceba6dd5c38152c90d678cd882c
branch: main
author: Guo Ci <[email protected]>
committer: ethanfurman <[email protected]>
date: 2025-10-30T10:32:55-07:00
summary:

gh-140766: [Enum] add `show_flag_values` and `bin` to `enum.__all__` (GH-140765)

Co-authored-by: Alex Waygood <[email protected]>

files:
A Misc/NEWS.d/next/Library/2025-10-29-16-53-00.gh-issue-140766.CNagKF.rst
M Lib/enum.py
M Lib/test/test_enum.py

diff --git a/Lib/enum.py b/Lib/enum.py
index 936bcea0619e7d..ad782b8c41e160 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -10,7 +10,8 @@
         'FlagBoundary', 'STRICT', 'CONFORM', 'EJECT', 'KEEP',
         'global_flag_repr', 'global_enum_repr', 'global_str', 'global_enum',
         'EnumCheck', 'CONTINUOUS', 'NAMED_FLAGS', 'UNIQUE',
-        'pickle_by_global_name', 'pickle_by_enum_name',
+        'pickle_by_global_name', 'pickle_by_enum_name', 'show_flag_values',
+        'bin',
         ]
 
 
diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py
index 7e509be0994248..66d78980c41cb6 100644
--- a/Lib/test/test_enum.py
+++ b/Lib/test/test_enum.py
@@ -5324,7 +5324,7 @@ def __new__(cls, value, label):
 class MiscTestCase(unittest.TestCase):
 
     def test__all__(self):
-        support.check__all__(self, enum, not_exported={'bin', 
'show_flag_values'})
+        support.check__all__(self, enum)
 
     @cpython_only
     def test_lazy_import(self):
diff --git 
a/Misc/NEWS.d/next/Library/2025-10-29-16-53-00.gh-issue-140766.CNagKF.rst 
b/Misc/NEWS.d/next/Library/2025-10-29-16-53-00.gh-issue-140766.CNagKF.rst
new file mode 100644
index 00000000000000..fce8dd33757aae
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2025-10-29-16-53-00.gh-issue-140766.CNagKF.rst
@@ -0,0 +1 @@
+Add :func:`enum.show_flag_values` and ``enum.bin`` to ``enum.__all__``.

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to