-
-
Notifications
You must be signed in to change notification settings - Fork 34.7k
Reflect it that sys.lazy_modules is no longer a flat set #145057
Copy link
Copy link
Closed
Labels
3.15pre-release feature fixes, bugs and security fixespre-release feature fixes, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-lazy-importstype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Metadata
Metadata
Assignees
Labels
3.15pre-release feature fixes, bugs and security fixespre-release feature fixes, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-lazy-importstype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Fields
Give feedbackNo fields configured for issues without a type.
Bug report
Bug description:
sys.lazy_modulesis now adict[str, set[str]], not a flat set. There's some places in the stdlib code that incorrectly suggests the older invariant.Most notable example:
cpython/Lib/test/test_import/test_lazy_imports.py
Lines 457 to 459 in 70da972
The PEP needs updating as well -- https://peps.python.org/pep-0810/#lazy-import-mechanism -- @DinoV, I think this is something you were working on, or is it open for contrib?
I'm happy to pick this one up (i.e. fixing our code to reflect
sys.lazy_modulesis a dict) if you'd like that! (Please reassign otherwise.)cc @pablogsal @DinoV @brittanyrey @Yhg1s
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
sys.lazy_modulesis a dict, not a set #146084