Pawel Lewicki wrote at 2003-4-8 18:56 +0200:
I don't know if my question is more zopish or pythonish. I have a Zope product. I had to add the specific functionality which is needed very rarely. I would be glad to import external module only when it is needed, do the job and free my mind and extra memory it consumed. How should I do that? I have to admit that I don't find myself as an experienced Python programmer. I just discover depths of this incredible language while extending my Zope product. Maybe anyone would help me with some relevant links.
Unless, your code is huge and your resources very limited, I would not worry at all. When you really want to get rid of the code, then you must delete *all* references (which may not be easy). There are hidden module references, e.g. "func_globals" in functions and in "sys.modules". Come back, when you really need it... Dieter