class test:
def __init__ (self, arg):
try:
self.attr = 1 / arg
print 'Success'
except:
print 'Exception'
def __del__ (self):
print 'Delete'
A test for this might look like:
Python 1.0.2 (May 13 1994)
Copyright 1991-1994 Stichting Mathematisch Centrum, Amsterdam
>>> import test
>>> a=test.test(1)
Success
>>> del a
Delete
>>> b=test.test(0)
Exception
>>> del b
>>>
________________________________________________________________
John Wezel
wezel@dial.eunet.ch