Skip to content

Instantly share code, notes, and snippets.

@mattmakesmaps
Created April 19, 2013 17:09
Show Gist options
  • Save mattmakesmaps/5421722 to your computer and use it in GitHub Desktop.
Save mattmakesmaps/5421722 to your computer and use it in GitHub Desktop.
Garbage in, Garbage out?
class tester(object):
def __init__(self, val):
self.val = val
print 'created in %s' % self.val
def __del__(self):
print 'deleted'
cache = {}
def f1():
print 'in f1'
t = tester('f1')
cache['tdict'] = t
def f2():
print 'in f2'
print type(cache['tdict'])
f1()
f2()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment