[Patches] [ python-Patches-1200018 ] Restore GC support to set objects

SourceForge.net noreply at sourceforge.net
Sat Jun 18 22:59:21 CEST 2005


Patches item #1200018, was opened at 2005-05-11 12:16
Message generated for change (Settings changed) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1200018&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core (C code)
Group: Python 2.4
>Status: Closed
>Resolution: Accepted
Priority: 7
Submitted By: Barry A. Warsaw (bwarsaw)
Assigned to: Raymond Hettinger (rhettinger)
Summary: Restore GC support to set objects

Initial Comment:
Contrary to what the log message for setobject.c 1.26
implies, built-in sets can indeed participate in
cycles, so they must support GC.  This patch restores
GC support to built-in sets for Python 2.4.  It should
be ported to Python 2.5.

----------------------------------------------------------------------

>Comment By: Raymond Hettinger (rhettinger)
Date: 2005-06-18 15:59

Message:
Logged In: YES 
user_id=80475

Okay, fixed.
Kept the PyDict_Clear since that is what is done in
dictobject.c.


----------------------------------------------------------------------

Comment By: Barry A. Warsaw (bwarsaw)
Date: 2005-05-11 17:41

Message:
Logged In: YES 
user_id=12800

Even without the __del__() method, notice how the second
gc.collect() prints 0.  With the patch it prints 4.


----------------------------------------------------------------------

Comment By: Jim Jewett (jimjjewett)
Date: 2005-05-11 17:20

Message:
Logged In: YES 
user_id=764593

Clarification:  cycle.py *as posted* does not demonstrate the 
problem, but if you uncomment the __del__ method in class 
foo, you will get uncollectable garbage.

----------------------------------------------------------------------

Comment By: Barry A. Warsaw (bwarsaw)
Date: 2005-05-11 14:59

Message:
Logged In: YES 
user_id=12800

cycle.py demonstrates the need for this patch

----------------------------------------------------------------------

Comment By: Barry A. Warsaw (bwarsaw)
Date: 2005-05-11 14:58

Message:
Logged In: YES 
user_id=12800

Actually, use set-patch2.txt because I don't believe you
need to clear so->data in set_tp_clear().

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1200018&group_id=5470


More information about the Patches mailing list