opposite of import
Gerhard Fiedler
gelists at gmail.com
Thu Aug 3 09:37:35 EDT 2006
On 2006-08-03 09:26:54, Simon Brunning wrote:
>> import amodule
>> amodule.afunction() # Works fine
>>
>> del amodule
>> amodule.afunction() # Will die now
>
> Note that this doesn't get rid of a module entirely. Python will still
> holds on to the module, and if you just import it again at this point,
> it won't be re-executed - you'll just get another reference to the
> original module.
Is that guaranteed, or is that just until the garbage collector has removed
the module (at some arbitrary point)?
Gerhard
More information about the Python-list
mailing list