[Cython] array assignment

Dag Sverre Seljebotn dagss at student.matnat.uio.no
Tue Oct 14 09:12:40 CEST 2008


Robert Bradshaw wrote:
> On Oct 11, 2008, at 7:31 AM, Dag Sverre Seljebotn wrote:
>> This absolutely shouldn't be more than half an hour, it is just about
>> throwing up a compiler error in the right transform.
> 
> Now that you put it that way, it makes it sound much easier--I love  
> transformations :). But I actually realize how much more restrictive  
> it is, as you can't do
> 
> cdef foo(int n, int* a):
>      ...
> 
> foo(5, [1,2,3,4,5])
> 
> which I think could be very useful. So I would maybe say disallow  
> array assignment except in declarations, but the above would still work.

As you pointed out in another post this was more hairy than I expected 
because of cdef transformation.

But anyway a patch is up doing this now. It is not tied to declaration, 
but what can Cython prove is the first assignment, but that works just 
as well (or better) for this purpose! (And is the same currently).

-- 
Dag Sverre


More information about the Cython-dev mailing list