Created
June 7, 2017 20:11
-
-
Save mitsuhiko/8b05a2e36e5981c12f90a52f8f03fb3a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> class A(object): | |
... def __del__(self): | |
... pass | |
... | |
>>> class B(object): | |
... def __del__(self): | |
... pass | |
... | |
>>> a = A() | |
>>> a.b = B() | |
>>> a.b.a = a | |
>>> import gc | |
>>> del a | |
>>> gc.collect() | |
4 | |
>>> gc.garbage | |
[<__main__.A object at 0x1028e4710>, <__main__.B object at 0x1028e4750>] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment