Re: Lazy Imports -- I Like This Idea

Gilmeh Serda <[email protected]> Sun, 29 Mar 2026 13:49:09 GMT
Newsgroups comp.lang.python
Organization Easynews - www.easynews.com
Message-ID <[email protected]>
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.

My 2¢ worth...

-- 
Gilmeh

"Plaese porrf raed." -- Prof. Michael O'Longhlin, S.U.N.Y. Purchase