[Python-Dev] GC bug with __slots__ ?

Tim Peters tim.one@comcast.net
2002年7月05日 19:09:03 -0400


This is already fixed in CVS Python. From CVS NEWS:
- Classes using __slots__ are now properly garbage collected.
 [SF bug 519621]
I suspect your laptop may be hiding in the repository too!
> -----Original Message-----
> From: python-dev-admin@python.org [mailto:python-dev-admin@python.org]On
> Behalf Of Christian Tismer
> Sent: Friday, July 05, 2002 7:02 PM
> Cc: python-dev@python.org
> Subject: [Python-Dev] GC bug with __slots__ ?
>>> 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 :-]
>>>>> _______________________________________________
> Python-Dev mailing list
> Python-Dev@python.org
> http://mail.python.org/mailman/listinfo/python-dev


AltStyle によって変換されたページ (->オリジナル) /