1import gc
2
3class old_style_class():
4    pass
5class new_style_class(object):
6    pass
7
8a = old_style_class()
9del a
10gc.collect()
11b = new_style_class()
12del b
13gc.collect()
14
15a = old_style_class()
16del old_style_class
17gc.collect()
18b = new_style_class()
19del new_style_class
20gc.collect()
21del a
22gc.collect()
23del b
24gc.collect()
25