deleting objects present in a list

Sandy dksreddy at gmail.com
Tue Apr 20 15:21:41 EDT 2010


Hi all,
I have large number of objects created and to handle them properly, I
store them in a list. How can I delete all of these objects (delete I
mean here is to remove the object from memory not just from list)? I
cannot use the list to iterate through the objects to delete them.
Because 'del' only reduces the reference count and as it is present in
the list it is not deleted. I cannot delete the list because I loose
control over the objects.

Can anyone give a nice solution for this?

Cheers,
dksr



More information about the Python-list mailing list