[Python-Dev] interning

Neil Schemenauer nas@python.ca
Sat, 10 Aug 2002 11:47:42 -0700


Guido van Rossum wrote:
> $ ./python ../Lib/test/regrtest.py -l test_gc
> test_gc
> Warning: test created 20 uncollectable object(s).
> 1 test OK.

Something weird is going on.  This patch fixes test_finalizer_newclass: 

--- Lib/test/test_gc.py 9 Aug 2002 17:38:16 -0000       1.19
+++ Lib/test/test_gc.py 10 Aug 2002 18:33:47 -0000
@@ -147,6 +147,8 @@
     else:
         raise TestFailed, "didn't find obj in garbage (finalizer)"
     gc.garbage.remove(obj)
+    del A, B, obj
+    gc.collect() # finds 13 objects!


I guess there is a reference cycle there that wasn't there before.
Could it have something to do with tp_del?

  Neil