python Programming Glossary: person4
__del__ method being called in python when it is not expected http://stackoverflow.com/questions/1935153/del-method-being-called-in-python-when-it-is-not-expected if I run the following script in Python 2.6.2 class Person4 '''Represents a person''' population 0 def __init__ self name.. #When the person is created they increase the population Person4.population 1 def __del__ self '''I am dying''' print ' s says.. self '''I am dying''' print ' s says bye' self.name Person4.population 1 if Person4.population 0 print 'I am the last one'..
|