FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-154675: reorganize some imports in importlib by brettcannon · Pull Request #154657 · python/cpython · GitHub

Repository navigation

gh-154675: reorganize some imports in importlib - #154657

Merged
brettcannon merged 5 commits into
python:mainfrom
brettcannon:lazy-importlib
Jul 27, 2026
Merged

brettcannon merged 5 commits into
python:mainfrom
brettcannon:lazy-importlib

Conversation

brettcannon commented Jul 24, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

brettcannon self-assigned this Jul 24, 2026
hugovk changed the title Use lazy imports in the top-level modules of importlib gh-154675: Use lazy imports in the top-level modules of importlib Jul 25, 2026
hugovk removed the skip issue label Jul 25, 2026

hugovk commented Jul 25, 2026

Copy link
Copy Markdown
Member

No objection to tidying the imports here, but I don't see much if any time saved here: _imp is a builtin and already loaded, warnings was already deferred.

We could get some good savings from importlib.resources (15ms -> 8ms) and importlib.metadata (10ms -> 7ms), but should also consider the backports.

Comment thread Lib/importlib/util.py

Copy link
Copy Markdown
Member Author

_imp is a builtin and already loaded

Good catch! I've reverted it.

warnings was already deferred.

True, but it bugged me enough that I've been wanting to make this change to the import since lazy imports were announced, so I consider it clean-up along with making the re-exporting more obvious.

We could get some good savings from importlib.resources (15ms -> 8ms) and importlib.metadata (10ms -> 7ms), but should also consider the backports.

I view that as a call for @jaraco to make as that's mostly their code.

brettcannon changed the title gh-154675: Use lazy imports in the top-level modules of importlib gh-154675: reorganize some imports in importlib Jul 27, 2026
brettcannon enabled auto-merge (squash) July 27, 2026 19:49
brettcannon merged commit 0284ce8 into python:main Jul 27, 2026
47 checks passed
brettcannon deleted the lazy-importlib branch July 27, 2026 20:18
mbeijen pushed a commit to mbeijen/cpython that referenced this pull request Aug 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL