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


Groups > comp.lang.python > #197747

Re: Lazy Imports -- I Like This Idea

Path csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
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 Fri, 27 Mar 2026 19:09:49 +0100
Organization A noiseless patient Spider
Lines 23
Message-ID <doti9m-kab.ln1@lazy.lzy> (permalink)
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

Show key headers only | View raw


On 26/03/2026 02.40, Lawrence D’Oliveiro wrote:
> So Python 3.15 will introduce a new, “lazy” import mechanism
> <https://peps.python.org/pep-0810/>.
> 
> 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

Back to comp.lang.python | Previous | NextPrevious in thread | Next 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