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, 3 Apr 2026 13:33:56 +0200 Organization: A noiseless patient Spider Lines: 45 Message-ID: <46l4am-j35.ln1@lazy.lzy> 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, 03 Apr 2026 11:38:46 +0000 (UTC) Injection-Info: dont-email.me; posting-host="683471943f01702913d8de7031666ad2"; logging-data="2036300"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+tgepGo2ytyUScHOs6qCJv" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:xmFtPFecQbQgJ5iDA0VjiuXBatU= Content-Language: it, en-GB In-Reply-To: Xref: csiph.com comp.lang.python:197758 On 29/03/2026 15.49, Gilmeh Serda wrote: > On Thu, 26 Mar 2026 01:40:15 -0000 (UTC), Lawrence D’Oliveiro wrote: > >> “Lazy” > > [PEP] TL;DR > > From the initial idea I got that now we have to have the word lazy > scattered all over the place for every module that needs to be loaded in > such a manner: > > lazy import blah > lazy import whatever > lazy from thisorthat import meh > > > Wouldn't it have been better if they used, e.g. "with" as a starter? Like > so: > > with lazy: > import blah > import whatever > from thisorthat import meh > > Then it would have been much smoother to handle. Why? It's one line more and large overhead for few imports. And the IDE can expand automatically the "lazy" part. Furthermore, it can always be added later, as alternative to explicit "lazy" in front of the import. So, I personally do not see this as needed feature now. > My 2¢ worth... Same... bye, -- piergiorgio