Suggested reading order:
- weakrefs.py - show you what weakrefs are (they're used in other examples)
- gc_basics.py - basics examples of python garbage collector at work
- finalizers.py - shows how you can use finalizers (__del__ method) to free resources associated with object; also shows how doing so breaks garbage collector (as a rule of thumb: don't use __del__ method)
- cat.py - show how you can use finaliser to resurrect an object
- exception_traceback.py - shows how the entire state of the stack is preserved after exception and can stay in memory for a looong time in worst case scenario