Skip to content

lazy imports allow lazy import math.pi #155194

Description

@DinoV

Bug report

Bug description:

lazy import math.pi
print(math.pi)

as reported: https://discuss.python.org/t/sys-lazy-modules-clarification/108385

This is a big difference in that we allow these in lazy imports but not normal imports. It's also due to just a bunch of extra unnecessary logic. Fixing this now seems like it'd be better than letting people start doing this.

CPython versions tested on:

3.15

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

Labels

type-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions