garbage collection problem
If a variable is created within a script that was executed using the %run command, there is a reference to it created somewhere
that prevents it from being garbage collected after deleting of the variable.
I am not sure if this is really a bug or just a misunderstanding on my side. However, it would be good if it were possible to delete
a variable created inside a script without deleting the whole name space using %reset.
This example is from an email thread in ipython-user: http://
create the following script named test_destructor.py and execute it using the ipython %run command:
kilian@chebang:~$ cat test_destructor.py
print 'deleting object...'
c = C()
kilian@chebang:~$ python test_destructor.py
now, let's try in ipython:
In : run test_destructor.py
In : del c
In : import gc
In : gc.collect()
(object still not deleted)
In : %reset
Once deleted, variables cannot be recovered. Proceed (y/[n])? y
|Changed in ipython:|
|status:||Fix Committed → Fix Released|