Skip to content

gh-155194: Fix not raising on non-module import - #155189

Open
DinoV wants to merge 2 commits into
python:mainfrom
DinoV:lazy_fixes_main
Open

gh-155194: Fix not raising on non-module import#155189
DinoV wants to merge 2 commits into
python:mainfrom
DinoV:lazy_fixes_main

Conversation

@DinoV

@DinoVDinoV commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

As initially reported here: https://discuss.python.org/t/sys-lazy-modules-clarification/108385

lazy import math.pi has divergent behavior from import math.pi. Currently we allow this to work and just give you the math module. Instead we should raise ModuleNotFoundError because math.pi is not a module.

@DinoVDinoV changed the title Fix not raising on non-module importgh-155194: Fix not raising on non-module importAug 4, 2026
Sign up for freeto 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.

1 participant

@DinoV