self destruction :)

Sean 'Shaleh' Perry shalehperry at
Thu Jun 27 16:13:51 EDT 2002

On 27-Jun-2002 Guyon Morée wrote:
> i've got a list of dynamicaly instantiated objects of a class of my own. how
> can i let one of the objects delete itself?
> i've tried: 'del self', but somehow it didn't work. afterwards it should
> also _not_ be in the list anymore.

mylist = [obj1, obj2, ....]
del obj1 # mylist still has a reference to obj1 so
         # the del simply decrements the ref count

More information about the Python-list mailing list