GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — lazy imports allow `lazy import math.pi` · Issue #155194 · python/cpython

lazy imports allow lazy import math.pi #155194

New issue
Copy link
New issue
Copy link
Closed
Closed
lazy imports allow lazy import math.pi#155194
Copy link
Assignees
DinoV
Labels
3.15bugs and security fixesbugs and security fixes3.16new features, bugs and security fixesnew features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)release-blockertopic-lazy-importstype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@DinoV
DinoV
opened on Aug 4, 2026
Issue body actions

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

  • gh-155194: Fix not raising on non-module import #155189
  • [3.15] gh-155194: Fix not raising on non-module import #155188
  • [3.15] gh-155194: Fix not raising on non-module import (GH-155189) #155983

Activity

  1. DinoV
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Aug 4, 2026
  2. DinoV
    self-assigned this
    on Aug 4, 2026
  3. StanFromIreland
    added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    topic-lazy-imports
    3.15bugs and security fixesbugs and security fixes
    3.16new features, bugs and security fixesnew features, bugs and security fixes
    on Aug 5, 2026
  4. encukou commented on Aug 11, 2026

    @encukou
    encukou
    on Aug 11, 2026
    Member
    More actions

    Hugo said:

    Yes, let's fix this for rc2, and do it in main first.

    I'll mark this as a release blocker for visibility.

    Reacted by Dino Viehland and Terry Jan Reedy
  5. encukou
    added
    release-blocker
    on Aug 11, 2026
  6. github-project-automation
    added this to Release and Deferred blockers 🚫on Aug 11, 2026
  7. github-project-automation
    moved this to Todo in Release and Deferred blockers 🚫on Aug 11, 2026
  8. DinoV
    added a commit that references this issue on Aug 14, 2026

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

    dffac61
  9. pablogsal
    added a commit that references this issue on Aug 19, 2026

    [3.15] gh-155194: Fix not raising on non-module import (GH-155189) (#…

    e531dd4
  10. encukou commented on Aug 21, 2026

    @encukou
    encukou
    on Aug 21, 2026
    Member
    More actions

    Thank you for the fix!

  11. encukou
    closed this as completedon Aug 21, 2026
  12. github-project-automation
    moved this from Todo to Done in Release and Deferred blockers 🚫on Aug 21, 2026
  13. brittanyrey
    added 2 commits that reference this issue on Sep 18, 2026

    Import a lazy submodule that a package attribute shadows

    00da645

    Import a lazy submodule that a package attribute shadows

    2b0aa85
  14. StanFromIreland
    marked test_concurrent_lazy_import_reification is flaky #154561 as a duplicate of this issue on Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @DinoV
    DinoV

Labels

3.15bugs and security fixesbugs and security fixes3.16new features, bugs and security fixesnew features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)release-blockertopic-lazy-importstype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Projects

  • Release and Deferred blockers 🚫
    Status
    Done
    Show more project fields

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.