[$] The return of lazy imports for Python

Post Syndicated from original https://lwn.net/Articles/917280/

Back in September, we looked at a Python
Enhancement Proposal (PEP) to add “lazy” imports to the language; the
execution of such an import would be deferred until its symbols were needed
in order to save program-startup time. While the problem of startup time
for short-running, often command-line-oriented, tools is widely
acknowledged in the Python community, and the idea of deferring imports is
generally popular, there are concerns about the effect of the feature on
the ecosystem as a whole. Since our article, the PEP has been revised and
discussed further, but the feature was recently rejected by the steering
council (SC) because of those concerns; that has not completely ended the
quest for lazy
imports, however.