Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Lawrence =?iso-8859-13?q?D=FFOliveiro?= Newsgroups: comp.lang.python Subject: Re: Lazy Imports -- I Like This Idea Date: Sun, 29 Mar 2026 22:35:37 -0000 (UTC) Organization: A noiseless patient Spider Lines: 23 Message-ID: <10qc9fp$1v9oe$1@dont-email.me> References: <10q22pv$2f060$2@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Sun, 29 Mar 2026 22:35:38 +0000 (UTC) Injection-Info: dont-email.me; posting-host="1908b88cc0afc863afeec0f9c8359f45"; logging-data="2074382"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Hk986uUCFYdUkwYE//16p" User-Agent: Pan/0.165 (Kostiantynivka) Cancel-Lock: sha1:NOKvYjCMnHrBl+fAXd4mCmQsT7o= Xref: csiph.com comp.lang.python:197751 On Sun, 29 Mar 2026 13:49:09 GMT, Gilmeh Serda wrote: > 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. I don’t think it will be needed for a great many modules. In my case, it was only ever an issue with matplotlib.