[Pyrex] [Cython-dev] Optimizing use of lists

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Nov 27 00:33:43 CET 2007


Robert Bradshaw wrote:
> I have thought for a while it would be nice to be able to do  something 
> like
> 
> cdef list L = [1,2,3]
> print L[0]
> 
> which would do know to do things via the fast api

I'm planning to do something very much like this in Pyrex
some time soon, as part of my general "teaching it about
the builtins" programme.

> except that it would do a type check on the L = ...  assignment

In that particular case, a typecheck shouldn't be needed,
since it would know that [...] always produces a builtin
list object.

--
Greg



More information about the Pyrex mailing list