Bug report
Bug description:
sys.lazy_modules is now a dict[str, set[str]], not a flat set. There's some places in the stdlib code that incorrectly suggests the older invariant.
Most notable example:
|
def test_lazy_modules_attribute_is_set(self): |
|
"""sys.lazy_modules should be a set per PEP 810.""" |
|
self.assertIsInstance(sys.lazy_modules, dict) |
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_modules is 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
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