[Python-ideas] Implicit submodule imports

Chris Angelico rosuav at gmail.com
Fri Sep 26 10:44:48 CEST 2014


On Fri, Sep 26, 2014 at 6:15 PM, Steven D'Aprano <steve at pearwood.info> wrote:
> By making importing automatic, every failed attribute access has to
> determine whether or not there is a sub-module to import, which could be
> quite expensive.

What if the package had to explicitly do a "stub import" that creates
something that, on first access (or first access of any of *its*
members), goes and loads up the module?

ChrisA


More information about the Python-ideas mailing list