Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: 7f10edebf0d6016d20af0fdae319f043718a991b authored by Larry Hastings on 16 January 2017, 08:19:54 UTC
Version bump for Python 3.4.6.
Tip revision: 7f10ede
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):
        pass
    U.__class__ = U
    del U
    gc.collect(); gc.collect(); gc.collect()
back to top