On Tue, Feb 7, 2012 at 16:19, Paul Moore <p.f.moore at gmail.com> wrote: > On 7 February 2012 20:49, Antoine Pitrou <solipsis at pitrou.net> wrote: > > Well, import time is so important that the Mercurial developers have > > written an on-demand import mechanism, to reduce the latency of > > command-line operations. > > One question here, I guess - does the importlib integration do > anything to make writing on-demand import mechanisms easier (I'd > suspect not, but you never know...) If it did, then performance issues > might be somewhat less of a sticking point, as usual depending on use > cases. Depends on what your feature set is. I have a fully working mixin you can add to any loader which makes it lazy if you trigger the import on reading an attribute from the module: http://code.google.com/p/importers/source/browse/importers/lazy.py . But if you want to trigger the import on *writing* an attribute then I have yet to make that work in Python source (maybe people have an idea on how to make that work since __setattr__ doesn't mix well with __getattribute__). -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20120207/f965ba80/attachment.html>
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