opposite of import

Simon Brunning simon at brunningonline.net
Thu Aug 3 09:46:54 EDT 2006


On 8/3/06, Gerhard Fiedler <gelists at gmail.com> wrote:
> Is that guaranteed, or is that just until the garbage collector has removed
> the module (at some arbitrary point)?

I *think* it's guaranteed.

It's not a matter for the garbage collector. GC only exists to remove
cyclic references. Ordinary reference counting *would* remove the
module as soon as you de referenced it, but for the fact that Python
stashes a reference to the module in (IIRC) sys.__modules__. And you
mess with *that* at your peril. ;-)

-- 
Cheers,
Simon B,
simon at brunningonline.net,
http://www.brunningonline.net/simon/blog/



More information about the Python-list mailing list