Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. populationList = []
  2. for i in range(0, 2000)
  3. populationList.append(myObject).
  4.  
  5. populationList = []
  6.  
  7. >>> class Foo:
  8. ... def __init__(self, x):
  9. ... self.x = x
  10. ... def __del__(self):
  11. ... print(self.x, 'deleted')
  12. ...
  13. >>> populationList = []
  14. >>> for i in range(5):
  15. ... populationList.append(Foo(i))
  16. ...
  17. >>> populationList = []
  18. 4 deleted
  19. 3 deleted
  20. 2 deleted
  21. 1 deleted
  22. 0 deleted
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement