destructors?
emile at fenx.com
emile at fenx.com
Tue May 23 18:09:12 EDT 2000
Use the __del__ method:
>>> class A:
def __del__(self):
print "in delete method"
>>> a = A()
>>> del a
in delete method
>>> a = A()
>>> b = a
>>> del a
>>> del b
in delete method
>>>
Emile van Sebille
emile at fenx.com
Z 3 Penguin <z3penguin at penguinpowered.com> wrote in message
news:<8geupp$oov$1 at bob.news.rcn.net>...
> I know python supports constructors with +AF8AXw-init+AF8AXw-, but does it have support
> for destructors (maybe +AF8AXw-del+AF8AXw-?+AF8-
>
> -----
> Z 3 Penguin
> z3p+AEA-z3penguin.org
>
> ()
> (o+AF8-
> //+AFw-
> +ADw--+AFwAXw-/
>
> This is a virus that works on the honor system. Send this .sig to everyone
> in your address book and randomly delete some of your files.
>
>
> --
> http://www.python.org/mailman/listinfo/python-list
>
More information about the Python-list
mailing list