1# Reference cycles involving only the ob_type field are rather uncommon 2# but possible. Inspired by SF bug 1469629. 3 4import gc 5 6def leak(): 7 class T(type): 8 pass 9 class U(type): 10 __metaclass__ = T 11 U.__class__ = U 12 del U 13 gc.collect(); gc.collect(); gc.collect() 14