On 11 June 2012 20:08, Pauli Virtanen <p...@iki.fi> wrote: > Hi, > > This doesn't work on Python 2.4 (works on >= 2.5): > > ------------ > cimport numpy as np > import numpy as np > > def _foo(): > cdef double[:] a > a = np.array([1.0]) > return np.asarray(a) > > def foo(): > print _foo() > ------------ > > Spotted when using Cython 1.6 in Scipy. Results to: > > Python 2.4.6 (#1, Nov 20 2010, 00:52:41) > [GCC 4.4.5] on linux2 > Type "help", "copyright", "credits" or "license" for more information. >>>> import fail >>>> fail.foo() > Traceback (most recent call last): > File "<stdin>", line 1, in ? > File "fail.pyx", line 10, in fail.foo (fail.c:1776) > print _foo() > File "fail.pyx", line 7, in fail._foo (fail.c:1715) > return np.asarray(a) > File > "/usr/local/stow/python-easy-install//lib/python2.4/site-packages/numpy/core/numeric.py", > line 235, in asarray > return array(a, dtype, copy=False, order=order) > File "stringsource", line 366, in > View.MemoryView.memoryview.__getitem__ (fail.c:5975) > File "stringsource", line 650, in View.MemoryView._unellipsify > (fail.c:9236) > TypeError: Cannot index with type '<type 'int'>' > > _______________________________________________ > cython-devel mailing list > cython-devel@python.org > http://mail.python.org/mailman/listinfo/cython-devel
Hey Pauli, Yeah, there was some weird bug with PyIndex_Check() not operating properly. Could you retry with the latest master? Mark _______________________________________________ cython-devel mailing list cython-devel@python.org http://mail.python.org/mailman/listinfo/cython-devel