print "employee __name__:"employee __name__ print "employee __module__:"employee __module__ print "employee __bases__:"employee __bases__ print "employee __dict__:"employee __dict__ when the above code is executedit produces the following resultemployee __doc__common base class for all employees employee __name__employee employee __module____main__ employee __bases__(employee __dict__{'__module__''__main__''displaycount''empcount' 'displayemployee''__doc__''common base class for all employees''__init__'destroying objects (garbag collection)python deletes unneeded objects (built-in types or class instancesautomatically to free memory space he process by which python periodically reclaims blocks of memory that no long er are in use is termed arbag collection python' arbag collector runs during prog ram execution and is trig ered when an object' reference count reaches zero an object' reference count chang es as the number of aliases that point to it chang es an object' reference count increases when it' assig ned new name or placed in container (listtuple or dictionaryt he object' reference count decreases when it' deleted with delits reference is reassig nedor its reference oes out of scope when an object' reference count reaches zeropython collects it automatically [bcreate object increase ref count increase ref count of of del [ - decrease ref count decrease ref count decrease ref count of of of you normally won' notice when the arbag collector destroys an orphaned instance and reclaims its space but class can implement the special method __del__()called destructorthat is invoked when the instance is about to be destroyed his method mig ht be used to clean up any nonmemory resources used by an instance examplet his __del__(destructor prints the class name of an instance that is about to be destroyed#!/usr/bin/python class pointdef __initselfx= = )self self def __del__(self)class_name self __class__ __name__ print class_name"destroyedpt point(pt pt pt pt print id(pt )id(pt )id(pt prints the ids of the obejcts del pt del pt del pt when the above code is executedit produces following result