Re: Proposal for a lazy-loading finder
Nick Coghlan <[email protected]> Sun, 9 Jul 2017 17:02:46 +1000
| Newsgroups | gmane.comp.python.import |
|---|---|
| Message-ID | <CADiSq7d5SKkkftDza8WCZSSO4Wx_7QfHr9ATu3W33b5j6w+PRg@mail.gmail.com> |
On 9 July 2017 at 09:56, Brett Cannon <[email protected]> wrote: > Please have a look at > https://notebooks.azure.com/Brett/libraries/di2Btqj7zSI/html/Lazy%20importing.ipynb > and let me know if I'm missing anything. I asked on Twitter if this would > work for Mercurial and it turns out it closely mirrors what they already do: > https://twitter.com/sid0/status/882775009051123712 (which is great since I > didn't look at their code to avoid any GPL issues even though our > relationship with the Mercurial devs is good enough to not have them sue us > over code re-use :) . With independent verification that the approach works > I'm fairly confident this can go into Python 3.7, but I still wanted to > double-check with this mailing list to make sure the API design and approach > seem sound. The technical approach seems sound, but from a naming perspective I'd suggest going with the more self-explanatory "ensure_lazy" and "ensure_eager" rather than "whitelist" and "blacklist". I'd also suggest that it would be nice to be able to do prefix matching rather than having to separately list every submodule of a package in either ensure_lazy or ensure_eager. Cheers, Nick. -- Nick Coghlan | [email protected] | Brisbane, Australia