[Import-SIG] latest update of PEP 451

Brett Cannon brett at python.org
Thu Sep 26 21:15:16 CEST 2013

On Thu, Sep 26, 2013 at 3:02 PM, Eric Snow <ericsnowcurrently at gmail.com>wrote:

> On Sep 25, 2013 7:05 AM, "Brett Cannon" <brett at python.org> wrote:
> > On Wed, Sep 25, 2013 at 1:46 AM, Eric Snow <ericsnowcurrently at gmail.com>
> wrote:


>  >> .. [lazy_import_concerns]
> https://mail.python.org/pipermail/python-dev/2013-August/128129.html
> >
> >
> > I should mention that this PEP will actually improve the situation for
> lazy loading compared to how it is in Python 3.3 when using
> __getattribute__. Because import now tries to backfill attributes like
> __package__ and __loader__, any module that is lazy based on attribute
> access automatically gets loaded by import itself. But with this PEP we can
> change import's semantics to not do that with spec-loaded modules and thus
> loader.exec_module() can insert a lazy module into sys.modules and know
> that it's attributes won't be touched unless you do a ``from ... import``
> on it.
> Yeah, I'm mostly focused on addressing concerns.  Would a lazy load
> example be worth adding to the PEP?

If it you don't think it will detract from the rest of the PEP it wouldn't
hurt. If you want I can write up some rough code to demonstrate how it
would work.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/import-sig/attachments/20130926/3187b691/attachment.html>

More information about the Import-SIG mailing list