Loading Modules

Cornelius Kölbel cornelius.koelbel at lsexperts.de
Wed Apr 13 11:09:25 EDT 2011


Hello list,

I am wondering about loading modules.What is a good way of doing this?

In my code I got one single function, where I need some functionality
from a built-in module.

Is it a better way to load the module only within the function
  pro: the function will only be hit every now and then or only with a
probability of 90%.
         So in 90% cases the modules will not be loaded. (preserve
resources)

What is the balance between speed, resources and code style?

Is there a pythonian way for deciding in which case to do what?

Kind regards
Cornelius

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20110413/87dba6de/attachment.sig>


More information about the Python-list mailing list