IT-Academy

Dest

Jan 28th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. class Bod:
  2.    def __init__( self, x=0, y=0):
  3.       self.x = x
  4.       self.y = y
  5.    def __del__(self):
  6.       menoTriedy = self.__class__.__name__
  7.       print "Objekt", menoTriedy, "bol zniceny"
  8.  
  9. bod1 = Bod()
  10. bod2 = bod1
  11. bod3 = bod1
  12. bod4 = Bod()
  13. print id(bod1), id(bod2), id(bod3) , id(bod4)
  14. del bod1
  15. del bod2
  16. del bod3
  17. del bod4
Add Comment
Please, Sign In to add comment