From: Paul F. D. <pau...@ho...> - 2000-02-08 20:24:11
|
Konrad wrote: > > In addition to backwards compatibility, there is another argument for > keeping indexing behaviour as it is: compatibility with other Python > sequence types. I claim the current Numeric is INconsistent with other Python sequence types: >>> x = [1, 2, 3, 4, 5] >>> y = x[2:5] >>> x [1, 2, 3, 4, 5] >>> y [3, 4, 5] >>> y[1] = 7 >>> y [3, 7, 5] >>> x [1, 2, 3, 4, 5] So, y is a copy of x[2:5], not a reference. |