Deleting objects - my earler post got garbled

"Martin v. Löwis" martin at v.loewis.de
Fri Apr 23 02:02:08 EDT 2004


Asun Friere wrote:
>>There is no way to explicitly delete an object in Python.
> 
> 
> So what does "del <object>" actually do then?

The syntax is not "del <object>", but "del <variable>".

It unbinds <variable> so that <variable> does no longer
refer to the object it used to refer to, very similar to
saying

<variable> = None

Whether that causes deletion of the object depends on
whether there are other reference to the same object,
in different variables.

Regards,
Martin




More information about the Python-list mailing list