[Patches] [ python-Patches-1501180 ] Cyclic garbage collection support for slices

SourceForge.net noreply at sourceforge.net
Mon Jun 5 23:36:40 CEST 2006


Patches item #1501180, was opened at 2006-06-05 21:15
Message generated for change (Settings changed) made by zseil
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1501180&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.5
>Status: Closed
>Resolution: Wont Fix
Priority: 5
Submitted By: Žiga Seilnacht (zseil)
Assigned to: Nobody/Anonymous (nobody)
Summary: Cyclic garbage collection support for slices

Initial Comment:
Slice's members start, stop and step can
be arbitrary python objects, which means
that slices can be easily included in
reference cycles (see the test in the
patch).
The patch includes the necessary changes
to enable support for the gc. Since slices
are immutable, there should be no need for
a tp_clear method.
I also changed the slice_dealloc function
to use Py_CLEAR macros instead of Py_DECREF.

I noticed that PySlice_GetIndices is still
missing support for types with a __index__
method. I don't know if that is intentional
or not.

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

>Comment By: Žiga Seilnacht (zseil)
Date: 2006-06-05 23:36

Message:
Logged In: YES 
user_id=1326842

OK, closing it.

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

Comment By: Tim Peters (tim_one)
Date: 2006-06-05 23:27

Message:
Logged In: YES 
user_id=31435

No offense, but thrust of this seems goofy.  Slice objects
aren't sanely used as containers for arbitrary objects, they
typically hold only integers and maybe None.  The decision
to leave them out of cyclic gc was therefore sensible; that
they can be abused in strained ways to create cycles seems
much more an exercise in determined perverseness than a
practical concern.

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

Comment By: Žiga Seilnacht (zseil)
Date: 2006-06-05 23:12

Message:
Logged In: YES 
user_id=1326842

Updated a misleading comment.

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

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


More information about the Patches mailing list