Message33574
| 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:48 | admin | link | issue400998 messages |
| 2007年08月23日 15:00:48 | admin | create |
|