[C++-sig] vector_indexing_suite and slicing
jbrandmeyer at earthlink.net
Tue Mar 16 21:19:50 CET 2004
A few months ago there was a discussion on this list related to the
semantics of setting a (possibly extended) slice when the setting range
is empty. As part of that discussion I submitted a patch to change
the behavior of a Python list . The resolution on that was to
clarify that list.__setitem__(slice, obj) has the following behavior
When called with a simple slice that defines an empty range, perform an
insertion at the first index.
When called with an extended slice regardless of the length of the
range, perform a replacement of the objects indexed by the slice with
objects from obj. obj must have exactly the same number of elements as
indexed by the slice.
To close the loop, the attached patch will fix the bugs I noted in 
while following the guidance provided by the Python folks. Unless there
are any objections, I'll commit this to HEAD and the RC_1_31_0 branch
: bug tracker for python
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 4288 bytes
Desc: not available
More information about the Cplusplus-sig