make objetcs 'commit suicide'
ykingma at accessforall.nl
Sun Jan 12 15:57:37 CET 2003
> class a:
> def go(self):
> self.__del__ # or del(self)
I suppose you mean:
> and then
> b is not destructed
Since b is defined at module level
instead of b.go() might be more appropriate.
Note that "del x" does not call x.__del__(),
it only removes the reference named x from the namespace.
In case the object referred to has it's reference count
go to zero because of the del statement, the __del__
method of the object _may_ be called.
email at xs4all.nl
More information about the Python-list