[Python-ideas] lazy import via __future__ or compiler analysis

Chris Angelico rosuav at gmail.com
Fri Sep 8 12:43:38 EDT 2017


On Sat, Sep 9, 2017 at 2:36 AM, Neil Schemenauer
<nas-python-ideas at arctrix.com> wrote:
> On 2017-09-09, Chris Angelico wrote:
>> Laziness has to be complete - or, looking the other way, eager
>> importing is infectious. For foo to be lazy, bar also has to be lazy;
>
> Not with the approach I'm proposing.  bar will be loaded in non-lazy
> fashion at the right time, foo can still be lazy.

Ah, that's cool then! I suppose part of the confusion I had was in the
true meaning of "lazy"; obviously you have to still load up the module
to some extent. I'm not entirely sure how much you defer and how much
you do immediately, and it looks like you have more in the 'defer'
category than I thought.

ChrisA


More information about the Python-ideas mailing list