[Cython] Bug, or changed array assignment in 0.17beta1?

Mike Zaletel mikezaletel at berkeley.edu
Wed Jul 25 00:40:22 CEST 2012


Hello All,
	The exact behavior of array assignment was never entirely clear to me, but I am certain the following behavior did not occur in 0.16:

--------bug.pyx----------

def foo():
       cdef int i
       cdef int* p1 = [4, 4]
       cdef int* p2 = [5, 5]

       print "p1:",
       for i in range(2):
               print p1[i],
       print "\np2:",
       for i in range(2):
               print p2[i],

-----------------------------

which in Cython 0.17beta1 gives me

>>>import bug
>>>bug.foo()
p1: 5 5
p2: 5 5


while in Cython 0.16 I get

>>>import bug
>>>bug.foo()
p1: 4 4
p2: 5 5



	Has the syntax of array assignment changed, or is this a bug? If the former, how do you assign to an array literal? Thanks for your all your efforts,

Mike


More information about the cython-devel mailing list