https://github.com/python/cpython/commit/9e8a9ac11afd2c06d4809f4d25c7c8cfb275d719
commit: 9e8a9ac11afd2c06d4809f4d25c7c8cfb275d719
branch: 3.14
author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com>
committer: hugovk <1324225+hug...@users.noreply.github.com>
date: 2025-08-08T18:13:22+03:00
summary:

[3.14] gh-137282: Fix `TypeError` in tab completion and `dir()` of 
`concurrent.futures` (GH-137214) (#137284)

Co-authored-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

Reply via email to