Is there any way to unimport a library

DevPlayer devplayer at gmail.com
Mon Nov 21 22:16:14 EST 2011


On Nov 20, 12:21 pm, Gelonida N <gelon... at gmail.com> wrote:
> I forgot to mention, that this is at the moment more a thought
> experiment, than a real need.
>
> At the moment I will do exactly what you suggested. I will make sure,
> that always the first import fails.
>
> But I wanted to learn more what is possible and which potential can of
> worms I would open if I wanted to unimport a library of which I'm sure
> that nobody is currently referencing (or refering? Not sure about my
> English here) to.

Get how many references to an object:
sys.getrefcount(sys)



More information about the Python-list mailing list