From: Guo Ci Date: Thu, 30 Oct 2025 17:32:55 +0000 (-0400) Subject: gh-140766: [Enum] add `show_flag_values` and `bin` to `enum.__all__` (GH-140765) X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e4deefbb2f93bceba6dd5c38152c90d678cd882c;p=thirdparty%2FPython%2Fcpython.git gh-140766: [Enum] add `show_flag_values` and `bin` to `enum.__all__` (GH-140765) Co-authored-by: Alex Waygood --- diff --git a/Lib/enum.py b/Lib/enum.py index 936bcea0619e..ad782b8c41e1 100644 --- a/Lib/enum.py +++ b/Lib/enum.py @@ -10,7 +10,8 @@ __all__ = [ '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 7e509be09942..66d78980c41c 100644 --- a/Lib/test/test_enum.py +++ b/Lib/test/test_enum.py @@ -5324,7 +5324,7 @@ class TestStdLib(unittest.TestCase): 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 000000000000..fce8dd33757a --- /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__``.