Python Steering Council unanimously accepts "PEP 810, Explicit lazy imports"
6 months ago
- #lazy-imports
- #Python
- #PEP
- The Steering Council unanimously accepted PEP 810, 'Explicit lazy imports'.
- The keyword 'lazy' was chosen over alternatives like 'defer' for imports.
- Lazy imports should start with the 'lazy' keyword for visual clarity.
- A subclass of dict for lazy imports was rejected as unnecessary.
- The PEP will not support lazy imports in .pth files.
- A new function 'sys.get_lazy_imports()' will be added.
- The PEP will clarify the precedence order for setting lazy import modes.
- Style recommendations for lazy imports will be left to linters and auto-formatters.