Destructor

Andrei Kulakov ak at silmarill.org
Tue May 21 15:58:54 EDT 2002


In article
<Pine.LNX.4.33.0205211409560.28461-100000 at vampire.cs.utexas.edu>,
Rajat Chopra wrote:
> 
> Hey Guys,
> 
> I have a very quick and basic question -- but I was just when exactly a
> Destructor is invoked? Do you have to delete the object (ex: del OBJECT )
> or is it enough to say OBJECT = None ???
> 
> Thanks,
> 
> Rajat
> 

Well, let's see..

>>> class t:
...  def __del__(self):
...   print "Deleting"
... 
>>> a = t()
>>> del a
Deleting
>>> a = t()
>>> a = None
Deleting



-- 
Cymbaline: intelligent learning mp3 player - python, linux, console.
get it at: cy.silmarill.org



More information about the Python-list mailing list