Skip to content

gh-158140: Resolve lazily imported sibling submodules independently - #158521

Draft
pablogsal wants to merge 1 commit into
python:mainfrom
pablogsal:fix-158140-independent-submodules
Draft

pablogsal wants to merge 1 commit into
python:mainfrom
pablogsal:fix-158140-independent-submodules

Conversation

@pablogsal

@pablogsal pablogsal commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Fixes #158140. With lazy import pkg.a followed by lazy import pkg.b, accessing pkg.a currently imports pkg.b first. Resolve ordinary dotted imports through the existing pending-child lookup, without publishing placeholders in package dictionaries. Custom namespace builtins and aliased parents retain their existing import behavior.

The lazy-import, import, importlib, module, sys and C API suites pass in debug and free-threaded builds. Regression tests cover independent siblings, star imports, declaration cleanup, deleted attributes, import hooks and failed-import retries.

@pablogsal

Copy link
Copy Markdown
Member Author

Sorry fucked up the squash give me sec

@pablogsal
pablogsal force-pushed the fix-158140-independent-submodules branch from 56babbc to 4e83bfa Compare October 1, 2026 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

Accessing one lazily imported submodule (lazy import pkg.a) also imports a later imported pkg.b

2 participants