]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-150579: use lazy imports for concurrent.futures (GH-150585)
authorHenry Schreiner <henryfs@princeton.edu>
Fri, 3 Jul 2026 18:11:16 +0000 (14:11 -0400)
committerGitHub <noreply@github.com>
Fri, 3 Jul 2026 18:11:16 +0000 (18:11 +0000)
commit423ae0ff36c6485f722e0fe3274124dc3df09862
tree15e48c59b3d75677b4c0baf9651ba2e36da97686
parenta90576d72c8a409f7c3ffcaefafb13945e3405ab
gh-150579: use lazy imports for concurrent.futures (GH-150585)

This module has a manual lazy import hack using `__getattr__`. Now that lazy imports exist and cannot be disabled, this could use lazy imports instead.

Key differences: this will now show up in sys.lazy_modules when accessed. Error messages should be a bit better without the wrapper `__getattr__` involved.  That's the only differences I can think of.

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Lib/concurrent/futures/__init__.py
Misc/NEWS.d/next/Library/2026-07-03-17-29-34.gh-issue-150579.0tLpQukIU.rst [new file with mode: 0644]