https://github.com/python/cpython/commit/2a87af062b79d914ce0120f1f1763213c1ebe8c4 commit: 2a87af062b79d914ce0120f1f1763213c1ebe8c4 branch: main author: Henry Schreiner <henryschreiner...@gmail.com> committer: ZeroIntensity <zintensity...@gmail.com> date: 2025-07-31T16:17:27Z summary:
gh-137282: Fix `TypeError` in tab completion and `dir()` of `concurrent.futures` (GH-137214) Signed-off-by: Henry Schreiner <henryschreiner...@gmail.com> files: A Misc/NEWS.d/next/Library/2025-07-31-10-31-56.gh-issue-137282.GOCwIC.rst M Lib/concurrent/futures/__init__.py M Lib/test/test___all__.py diff --git a/Lib/concurrent/futures/__init__.py b/Lib/concurrent/futures/__init__.py index e717222cf98b32..d6ac4b3e0b675f 100644 --- a/Lib/concurrent/futures/__init__.py +++ b/Lib/concurrent/futures/__init__.py @@ -44,7 +44,7 @@ def __dir__(): - return __all__ + ('__author__', '__doc__') + return __all__ + ['__author__', '__doc__'] def __getattr__(name): diff --git a/Lib/test/test___all__.py b/Lib/test/test___all__.py index f35b1194308262..8ded9f99248372 100644 --- a/Lib/test/test___all__.py +++ b/Lib/test/test___all__.py @@ -72,6 +72,8 @@ def check_all(self, modname): all_set = set(all_list) self.assertCountEqual(all_set, all_list, "in module {}".format(modname)) self.assertEqual(keys, all_set, "in module {}".format(modname)) + # Verify __dir__ is non-empty and doesn't produce an error + self.assertTrue(dir(sys.modules[modname])) def walk_modules(self, basedir, modpath): for fn in sorted(os.listdir(basedir)): diff --git a/Misc/NEWS.d/next/Library/2025-07-31-10-31-56.gh-issue-137282.GOCwIC.rst b/Misc/NEWS.d/next/Library/2025-07-31-10-31-56.gh-issue-137282.GOCwIC.rst new file mode 100644 index 00000000000000..78f169ea029b17 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-07-31-10-31-56.gh-issue-137282.GOCwIC.rst @@ -0,0 +1 @@ +Fix tab completion and :func:`dir` on :mod:`concurrent.futures`. _______________________________________________ Python-checkins mailing list -- python-checkins@python.org To unsubscribe send an email to python-checkins-le...@python.org https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: arch...@mail-archive.com