Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import gc
- from pprint import pprint
- import weakref
- from weakref_graph import Graph, demo, collect_and_show_garbage
- gc.set_debug(gc.DEBUG_LEAK)
- print 'Setting up the cycle'
- print
- demo(Graph)
- print
- print 'Breaking the cycle and cleaning up the garbage'
- print
- gc.garbage[0].set_next(None)
- while gc.garbage:
- del gc.garbage[0]
- print
- collect_and_show_garbage()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement