Skip to content

Instantly share code, notes, and snippets.

Created Oct 15, 2020
What would you like to do?
class Message:
def __init__(self):
self._exception = None
def __del__(self):
print("running after object number %d was allocated" % i)
def f():
raise RuntimeError("test")
def g():
m = Message()
d = {"a": m} # putting something else on the stack with a reference to m
except Exception as e:
m._exception = e
i = 0
os = []
for i in range(1000):
os.append({"a%d" % i: i})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment