__del__ Is a Destructor : Del : Class PYTHON TUTORIALS


PYTHON TUTORIALS » Class » Del »

 

__del__ Is a Destructor


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

brian = Life('A')
brian = 'B'

del brian



Leave a Comment / Note


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


PYTHON TUTORIALS

 Navioo Class
» Del