Class destructor : Class del : Class PYTHON examples


PYTHON examples » Class » Class del »

 

Class destructor


Class destructor: __del__


class Life:
     def __init__(self, name='unknown'):
         print 'Hello', name
         self.name = name
     def __del__(self):
         print 'Goodbye', self.name

brian = Life('Brian')

brian = 'loretta'

print "Before delete"

print brian

del brian

print "after delete"


           
       



    Related Scripts with Example Source Code in same category :

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Class
» Class del


Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0