Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #197758

Re: Lazy Imports -- I Like This Idea

From Piergiorgio Sartor <piergiorgio.sartor.this.should.not.be.used@nexgo.REMOVETHIS.de>
Newsgroups comp.lang.python
Subject Re: Lazy Imports -- I Like This Idea
Date 2026-04-03 13:33 +0200
Organization A noiseless patient Spider
Message-ID <46l4am-j35.ln1@lazy.lzy> (permalink)
References <10q22pv$2f060$2@dont-email.me> <p5ayR.164248$o4va.120026@fx17.ams4>

Show all headers | View raw


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

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar


Thread

Lazy Imports -- I Like This Idea Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-03-26 01:40 +0000
  Re: Lazy Imports -- I Like This Idea Piergiorgio Sartor <piergiorgio.sartor.this.should.not.be.used@nexgo.REMOVETHIS.de> - 2026-03-27 19:09 +0100
  Re: Lazy Imports -- I Like This Idea DFS <nospam@dfs.com> - 2026-03-28 00:59 -0400
    Re: Lazy Imports -- I Like This Idea Piergiorgio Sartor <piergiorgio.sartor.this.should.not.be.used@nexgo.REMOVETHIS.de> - 2026-03-28 11:40 +0100
    Re: Lazy Imports -- I Like This Idea Jason H <jason_hindle@yahoo.com> - 2026-04-14 22:16 +0000
  Re: Lazy Imports -- I Like This Idea Gilmeh Serda <gilmeh.serda@nothing.here.invalid> - 2026-03-29 13:49 +0000
    Re: Lazy Imports -- I Like This Idea Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-03-29 22:35 +0000
      Re: Lazy Imports -- I Like This Idea Paul Rubin <no.email@nospam.invalid> - 2026-03-29 19:03 -0700
        Re: Lazy Imports -- I Like This Idea Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-03-30 02:17 +0000
          Re: Lazy Imports -- I Like This Idea Paul Rubin <no.email@nospam.invalid> - 2026-03-30 11:21 -0700
      Re: Lazy Imports -- I Like This Idea Gilmeh Serda <gilmeh.serda@nothing.here.invalid> - 2026-04-03 11:12 +0000
        Re: Lazy Imports -- I Like This Idea Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-04-03 22:45 +0000
    Re: Lazy Imports -- I Like This Idea Piergiorgio Sartor <piergiorgio.sartor.this.should.not.be.used@nexgo.REMOVETHIS.de> - 2026-04-03 13:33 +0200

csiph-web