Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: 6cc7940e10372aa696ac62d9ab00bf0717a94ae6 authored by Barry Warsaw on 08 May 2008, 13:16:19 UTC
Bump to 2.6a3
Tip revision: 6cc7940
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