Python’s import system could be in for its biggest change in years.
Lazy imports are controlled, in the sense that deferred loading is only triggered by the importing code itself.
This avoids shifting responsibility onto downstream users and prevents accidental surprises in library behavior.
The new explicit lazy import mechanism enhances security by deferring module initialization until runtime, thereby minimizing the attack surface and preventing premature execution of potentially vulnerable or malicious code during application startup.
See on the official website.