On Oct 2, 2017, at 14:56, Brett Cannon <brett at python.org> wrote: > So Mercurial specifically is an odd duck because they already do lazy importing (in fact they are using the lazy loading support from importlib). In terms of all of this discussion of tweaking import to be lazy, I think the best approach would be providing an opt-in solution that CLI tools can turn on ASAP while the default stays eager. That way everyone gets what they want while the stdlib provides a shared solution that's maintained alongside import itself to make sure it functions appropriately. The problem I think is that to get full benefit of lazy loading, it has to be turned on globally for bare ‘import’ statements. A typical application has tons of dependencies and all those libraries are also doing module global imports, so unless lazy loading somehow covers them, it’ll be an incomplete gain. But of course it’ll take forever for all your dependencies to use whatever new API we come up with, and if it’s not as convenient to write as ‘import foo’ then I suspect it won’t much catch on anyway. -Barry -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: Message signed with OpenPGP URL: <http://mail.python.org/pipermail/python-dev/attachments/20171002/ea4afa41/attachment.sig>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4