Earlier quoted context omitted.
You have always been able to do the same thing in Python. This PEP isn't needed for that functionality.
You can declare imports at the beginning of a program that don’t load until they are used?
Python Steering Council unanimously accepts "PEP 810, Explicit lazy imports"
61–64 of 64 posts
Re: Python Steering Council unanimously accepts "PEP 810, Explicit lazy imports"
#62Re: Python Steering Council unanimously accepts "PEP 810, Explicit lazy imports"
#63This is great for building modules. One can now lazy import all interesting names on __init__.py, so that instead of having to remember `from module.some_submodule_that_you_need_to_remember import method` you can just do `from module import name`.
https://peps.python.org/pep-0810/#what-about-star-imports-fr... > What about star imports (`from module import *`)? > Wild card (star) imports cannot be lazy - they remain eager. This is because the set of names being imported cannot be determined without loading the module. Using the lazy keyword with star imports will be a syntax error. If lazy imports are globally enabled, star imports will still be eager. Additio…
Re: Python Steering Council unanimously accepts "PEP 810, Explicit lazy imports"
#64Earlier quoted context omitted.
https://peps.python.org/pep-0810/#what-about-star-imports-fr... > What about star imports (`from module import *`)? > Wild card (star) imports cannot be lazy - they remain eager. This is because the set of names being imported cannot be determined without loading the module. Using the lazy keyword with star imports will be a syntax error. If lazy imports are globally enabled, star imports will still be eager. Additio…
? This has nothing to do with star imports