Skip to content

gh-154675: Use lazy imports in the top-level modules of importlib#154657

Open
brettcannon wants to merge 1 commit into
python:mainfrom
brettcannon:lazy-importlib
Open

gh-154675: Use lazy imports in the top-level modules of importlib#154657
brettcannon wants to merge 1 commit into
python:mainfrom
brettcannon:lazy-importlib

Conversation

@brettcannon

@brettcannon brettcannon commented Jul 24, 2026

Copy link
Copy Markdown
Member

@brettcannon brettcannon self-assigned this Jul 24, 2026
@hugovk 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 hugovk removed the skip issue label Jul 25, 2026
@hugovk

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.

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.

2 participants