[Patches] [ python-Patches-873305 ] list.__setitem__(slice) behavior

SourceForge.net noreply at sourceforge.net
Thu Jan 8 15:46:57 EST 2004


Patches item #873305, was opened at 2004-01-08 15:46
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=873305&group_id=5470

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Jonathan Brandmeyer (jbrandmeyer)
Assigned to: Nobody/Anonymous (nobody)
Summary: list.__setitem__(slice) behavior

Initial Comment:
Consider the following:
>>> x = [0, 1, 2, 3, 4]
>>> x[-1:0] = [5, 6, 7]

Currently the result is that x == [0,1,2,3,5,6,7,4]. 
However, I believe that calling setitem with an empty
slice should be a no-op, rather than performing an
insertion starting at the 'begin' index of the slice.

The following patch to Objects/listobject.c makes this
change.

Thanks,
Jonathan Brandmeyer

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

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



More information about the Patches mailing list