[Numpy-discussion] Re: [Matrix-SIG] An Experiment in code-cleanup.

Paul F. Dubois pauldubois at home.com
Tue Feb 8 14:16:55 CST 2000


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.







More information about the Numpy-discussion mailing list