26 Sep
2014
26 Sep
'14
3:31 p.m.
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.