Skip to content

gh-158140: Resolve lazy submodules independently with custom import hooks - #158815

Draft
pablogsal wants to merge 1 commit into
python:mainfrom
pablogsal:lazy-import-independent-restart
Draft

pablogsal wants to merge 1 commit into
python:mainfrom
pablogsal:lazy-import-independent-restart

Conversation

@pablogsal

@pablogsal pablogsal commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Resolve ordinary packages from the root down, so accessing one lazy submodule doesn't import its siblings. Keep pending declarations by builtins namespace and use the matching namespace's current __import__ hook, while preserving the existing behavior for hooks that return private objects.

@read-the-docs-community

read-the-docs-community Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #34936132 | 📁 Comparing 979f879 against main (e0861c6)

  🔍 Preview build  

3 files changed
± reference/simple_stmts.html
± using/configure.html
± whatsnew/changelog.html

@pablogsal
pablogsal force-pushed the lazy-import-independent-restart branch from f995729 to 4f72c54 Compare October 5, 2026 01:19
@pablogsal
pablogsal force-pushed the lazy-import-independent-restart branch from 4f72c54 to 979f879 Compare October 5, 2026 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant