[Cython] List type, link on Wiki front-page

Robert Bradshaw robertwb at math.washington.edu
Mon May 4 21:37:33 CEST 2009


On May 4, 2009, at 11:33 AM, Stéfan van der Walt wrote:

> Hi all,
>
> Is there a way to tell Cython if you are using a homogeneous list?   
> E.g.
>
> cdef list[int] my_list
>
> my_list.append(1)
> my_list.append(2)
>

No, there's not. It would be nice, but it would be hard to control  
what people stick in the list (e.g. if you pass it off to another  
routine). You might want to look at using NumPy arrays, which can  
store lists of actual c ints, etc.

- Robert



More information about the Cython-dev mailing list