Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Piergiorgio Sartor Newsgroups: comp.lang.python Subject: Re: Lazy Imports -- I Like This Idea Date: Fri, 27 Mar 2026 19:09:49 +0100 Organization: A noiseless patient Spider Lines: 23 Message-ID: References: <10q22pv$2f060$2@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Fri, 27 Mar 2026 18:13:41 +0000 (UTC) Injection-Info: dont-email.me; posting-host="10da464f11e29e8563b752787d0e53de"; logging-data="4171423"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18O480i2HfQ4XaJa9F9r53c" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:TLRsNAOMyI9E+rAGHoim0esmVsU= Content-Language: it, en-GB In-Reply-To: <10q22pv$2f060$2@dont-email.me> Xref: csiph.com comp.lang.python:197747 On 26/03/2026 02.40, Lawrence D’Oliveiro wrote: > So Python 3.15 will introduce a new, “lazy” import mechanism > . > > So far I have done one script where I moved an import into the > function where it was used, instead of doing it globally; this reduced > the script startup time from around 1.5 seconds down to about a > quarter second. > > “Lazy” imports would avoid the need for such workarounds, while > keeping all imports together so they can be found more easily. Interesting, I needed this as well. Last time I checked, the suggestion was rejected... Good if they changed their mind. bye, -- piergiorgio