This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gvanrossum
Recipients
Date 2002-06-07.14:40:31
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=6380

I checked the Numeric-21.0 source, and they don't use
PySlice_GetIndices. They have their own function,
slice_GetIndices, which appears to be a reformatted copy of
PySlice_GetIndices. except that the fiddling at the end is
different: it truncates out-of-bounds indices rather than
calling them errors, and it doesn't call step==0 an error
(why?).

I also checked the numarray-0.3.3 source, and they don't do
slices yet.

So I think we're safe fixing PySlice_GetIndices.

However, I think there's a bug in your code. Suppose a is
range(10). Then a[1000:] returns []. But a[1000::] returns
[9]! Similarly, a[-1000::-1] return [0] where I would expect
[]. I think the start/stop truncation needs to depend on the
step, too.
History
Date User Action Args
2007-08-23 15:00:48adminlinkissue400998 messages
2007-08-23 15:00:48admincreate