Jason Tackaberry wrote: > On Tue, 2007-01-23 at 21:43 +0100, Dirk Meyer wrote: >> +# python imports >> +import urllib2 >> + >> +# kaa.notifier imports >> +from kaa.notifier import Thread, Signals, InProgress > > I think we should start trying to use lazy importing more.
Agreed. > In this case, we really only need to import imlib2 in the constructor of > the URL class (and add it to globals if needed). No need to import the > module unless we need to use it. First of all: urllib2, not imlib2. Second: well we could do the import urllib2 when URL is used but using 'import' inside the function always looks ugly to me. > But actually I wonder if a more generic solution would be workable. > It'd be possible to hook import to do load a module only once it is > referenced. I think this approach would work (would need to test it > though), although care will still have to be taken that we don't > reference modules until they truly are needed. How? It is nice to use kaa.notifier.URL without importing the submodule in my code. Dischi -- The sum of society's intelligence is less than the average of it's individual parts.
pgpCMP2cQ1nK4.pgp
Description: PGP signature
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ Freevo-devel mailing list Freevo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freevo-devel