[Cython] array assignment

Greg Ewing greg.ewing at canterbury.ac.nz
Sat Oct 11 09:24:20 CEST 2008


Robert Bradshaw wrote:

> It's on the stack, just like literals.

What do you mean, "just like literals"? What literal
is ever allocated on the stack?

 > However, one can write
> 
> def foo(x, y):
>      cdef double* a
>      if x:
>          a = [1,2,3,x]
>      else:
>          a = [1,2,3,y]

Now I'm *really* confused. What the heck does that do?
Can you provide a C translation?

-- 
Greg


More information about the Cython-dev mailing list