[C++-sig] vector_indexing_suite and slicing
Joel de Guzman
joel at boost-consulting.com
Thu Mar 18 14:09:42 CET 2004
Jonathan Brandmeyer wrote:
> 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[1]. As part of that discussion I submitted a patch to change
> the behavior of a Python list [2]. The resolution on that was to
> clarify that list.__setitem__(slice, obj) has the following behavior
> (no changes):
>
> 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 [3]
> 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
> tonight.
>
> -Jonathan Brandmeyer
>
>
> [1]: summary
> http://mail.python.org/pipermail/c++-sig/2004-January/006589.html
> [2]: bug tracker for python
> https://sourceforge.net/tracker/?func=detail&atid=305470&aid=873305&group_id=5470
> [3]: http://mail.python.org/pipermail/c++-sig/2004-January/006552.html
No objections here. I wonder though about the status of Raoul's
new indexing suite. I was under the impression that his work will
supersede the current indexing suite. Raoul?
Cheers,
--
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net
More information about the Cplusplus-sig
mailing list