Neilen Marais wrote:
>Hi,
>
>I'm not sure if the following is expected to work on a 64bit machine:
>
>In [381]: import numpy as N
>In [382]: l = range(3)
>In [383]: i32 = N.array([0,2], N.int32)
>In [384]: i64 = N.array([0,2], N.int64)
>In [385]: l[i32[0]]
>---------------------------------------------------------------------------
>exceptions.TypeError Traceback (most recent call last)
>
>/home/brick/akademie/NewCode/working/<ipython console>
>
>TypeError: list indices must be integers
>
>In [386]: l[i64[0]]
>Out[386]: 0
>
>I'd expect the 32-bit indices to work since they can be upcast to 64bit without
>loss. Am I silly for thinking this way, or is it something numpy can/should
>address? This came up while working with sparse matrices:
>
>http://projects.scipy.org/scipy/scipy/ticket/307
>
>
It's addressed with Python 2.5
We can't do anything about it for Python 2.4
-Travis
|