What is the cleanest way to for a module to access objects from the script that imports it?

Gabriel Genellina gagsl-py at yahoo.com.ar
Fri Oct 27 19:43:34 EDT 2006


At Friday 27/10/2006 19:48, noamsml at gmail.com wrote:

>Wouldn't importing and re-importing the same modules cause considerable
>resource bulk? Or does python cache that stuff?

No. Once a module is imported by the first time, the module object is 
placed in sys.modules; if a subsequent import finds the module there, 
it's not reloaded from disk.
See <http://docs.python.org/ref/import.html>


-- 
Gabriel Genellina
Softlab SRL 

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar



More information about the Python-list mailing list