Re: Lazy Imports -- I Like This Idea

Piergiorgio Sartor <[email protected]> Sat, 28 Mar 2026 11:40:47 +0100
Newsgroups comp.lang.python
Organization A noiseless patient Spider
Message-ID <[email protected]>
On 28/03/2026 05.59, DFS wrote:
[...]
> Faster startup is nice, but lazy importing doesn't reduce total runtime 
> of the program, right?

Different objective, anyway.

It *might* reduce total runtime, it depends
on the code structure.

If the code is multi-threaded, likely having
the imports *per thread* is better than having
them globally.

YMMV

bye,

-- 

piergiorgio