Re: Proposal for a lazy-loading finder
Antoine Pitrou <[email protected]> Sun, 9 Jul 2017 12:03:41 +0200
| Newsgroups | gmane.comp.python.import |
|---|---|
| Message-ID | <20170709120341.2647c8df@fsol> |
On Sat, 08 Jul 2017 23:56:05 +0000 Brett Cannon <[email protected]> wrote: > At PyCon US I found out that even though I tried to minimize people using > importlib.util.LazyLoader, a bunch of people are using beyond the intended > audience which was advanced Python users such as the Mercurial team. > Knowing that people were somewhat ignoring the warnings about the dangers > of using LazyLoader, I figured it was finally time to implement a > lazy-loading finder to make sure people don't duplicate the same work and > to make sure that it is implemented properly and can change as importlib > itself does. (Plus I needed a coding break from workflow stuff while I was > stuck in the US for a conference :) . > > Please have a look at > https://notebooks.azure.com/Brett/libraries/di2Btqj7zSI/html/Lazy%20importing.ipynb Are LazyLoadingFinder() and activate_lazy_loading() as quoted there really all that's needed? Sounds good :-) I would suggest allow people to fully customize the blacklist / whitelist logic using a callable (because looking up by fullname is a bit inflexible). Regards Antoine.