[PYTHON MATRIX-SIG] Re: Array indexing bug + strange behaviour
Carlos Fonseca
Carlos Fonseca <fonseca@gaivota.demon.co.uk>
Sun, 18 Aug 1996 17:54:09 +0100 (BST)
This bug is still in 1.0a2. This happens under Linux 2.0.12, gcc 2.7.2
(from the Debian distribution, which has the strength-reduce bug fixed).
I've linked NumPy dynamically, but it also happens with NumPy statically
linked.
On Tue, 13 Aug 1996, Carlos Fonseca wrote:
> This seems to be reproducible. Found it by chance...
>
> Python 1.4b2 (Aug 11 1996) [GCC 2.7.2]
> Copyright 1991-1996 Stichting Mathematisch Centrum, Amsterdam
> >>> from Numeric import *
> >>> a=arange(10)
> >>> a[10:10].shape
> (0,)
> >>> a[-1:10].shape
> IndexError: index out of bounds
> >>> a[-1:10].shape
> (1,)
> >>>
>
> Carlos
The only thing unusual with my setup is that I compiled the interpreter
with -O4. If nobody else can reproduce this, I'll try recompiling it with
a more conservative setting. The numeric modules themselves were compiled
with -g (the default).
The other bug reported by Jean-Bernard ADDOR is also there:
>>> max(arange(5),3)
0 1 2 3 4
>>> min(arange(5),3)
3
Carlos
=================
MATRIX-SIG - SIG on Matrix Math for Python
send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================