[Python-ideas] Implicit submodule imports

Thomas Gläßle t_glaessle at gmx.de
Fri Sep 26 23:31:05 CEST 2014


Thomas Gläßle wrote on 09/26/2014 11:03 PM:
> Imagine, we had a class LazyModule (or w/e name) class in the stdlib.
> One could just do:
>
>     __new__.py:
>         from importlib import LazyModule as __metamodule__ # (or
> __metapackage?)
>
>
> Maybe, LazyModule could resolve only attributes, that are explicitly
> given in __all__ (or more explicitly __autoimport__?).

On second thought. Scratch all of that. This is easy enough to do it a
few lines of code and customize to the specific use case. Sorry for the
noise, I think it's too late for my brain to work well;)
Using an __autoimport__ list could still be an option if not resorting
to the metamodule.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140926/3c352238/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140926/3c352238/attachment-0001.sig>


More information about the Python-ideas mailing list