Showing content from http://mail.python.org/pipermail/python-dev/attachments/20171009/ffe93b1c/attachment.html below:
<br><br><div class="gmail_quote"><div dir="ltr">On Mon, Oct 2, 2017, 17:49 Ronald Oussoren, <<a href="mailto:ronaldoussoren@mac.com">ronaldoussoren@mac.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Op 3 okt. 2017 om 04:29 heeft Barry Warsaw <<a href="mailto:barry@python.org" target="_blank">barry@python.org</a>> het volgende geschreven:<br>
<br>
> On Oct 2, 2017, at 14:56, Brett Cannon <<a href="mailto:brett@python.org" target="_blank">brett@python.org</a>> wrote:<br>
><br>
>> 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.<br>
><br>
> 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.<br>
><br>
<br>
One thing to keep in mind is that imports can have important side-effects. Turning every import statement into a lazy import will not be backward compatible.<br></blockquote></div><div><br></div><div>Yep, and that's a lesson Mercurial shared with me at PyCon US this year. My planned approach has a blacklist for modules to only load eagerly.</div><div><br></div><div>-Brett</div><div><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Ronald<br>
_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org" target="_blank">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/brett%40python.org" rel="noreferrer" target="_blank">https://mail.python.org/mailman/options/python-dev/brett%40python.org</a><br>
</blockquote></div>
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