mirror of https://github.com/python/cpython
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:
parent
db4018f320
commit
969ef7501c
|
@ -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()
|
Loading…
Reference in New Issue