[C++-sig] Re: vector_indexing_suite and slicing

Raoul Gough RaoulGough at yahoo.co.uk
Sun Mar 21 20:52:54 CET 2004


Joel de Guzman <joel at boost-consulting.com> writes:

> 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?

I'm pretty sure I mentioned my work in the same thread back in
January, and that the slice behaviour of the new indexing suite was
already Python compliant.

I haven't had time recently to get the documentation in order, but I
intend to get that done before the ACCU conference in mid-April. Once
the docco is ready, we could probably consider merging indexing_v2
onto the mainline, but I guess there's no harm in patching the
original indexing suite in the meantime.

-- 
Raoul Gough.
export LESS='-X'





More information about the Cplusplus-sig mailing list