[Python-Dev] GC bug with __slots__ ?

Christian Tismer tismer@tismer.com
Fri, 05 Jul 2002 23:01:43 +0000


Hi Guido,

I haven't been able to search lists since
my laptop is stolen, so maybethis is a known issue:

When I create a cyclic reference in a class with
slots, it will not be detected by gc.

#This one works fine:

class a(int): pass
x=a(7)
x.x=x
del x
gc.collect # frees cycle

#This one doesn't:

class a(int): __slots__=["x"]
x=a(7)
x.x=x
del x
gc.collect # frees cycle

ciao - chris  (greetings from iceland)

[yes there is no .sig, was stolen, too :-]