Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: cd2070590286b52b7aebfb4ed4fe409ac759f94d authored by Benjamin Peterson on 29 May 2011, 21:50:27 UTC
bump to 2.7.2rc1
Tip revision: cd20705
test_selftype.py
# Reference cycles involving only the ob_type field are rather uncommon
# but possible.  Inspired by SF bug 1469629.

import gc

def leak():
    class T(type):
        pass
    class U(type):
        __metaclass__ = T
    U.__class__ = U
    del U
    gc.collect(); gc.collect(); gc.collect()
back to top