Show case: reference cycles involving only the ob_type field are rather

uncommon but possible.  Inspired by SF bug 1469629.
This commit is contained in:
Armin Rigo 2006-04-14 14:58:30 +00:00
parent db4018f320
commit 969ef7501c
1 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,13 @@
# 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()