Stefan Behnel wrote: > Robert Bradshaw wrote: >> On Nov 13, 2008, at 2:30 PM, Stefan Behnel wrote: >>> However, the way it's currently implemented does no bounds >>> checking, so it's >>> pretty easy to shoot yourself in the foot when you assign non- >>> existing slices. >>> It's actually not so easy to determine at compile time how long the >>> lhs slice is, and how long the assigned sequence is. >>> >>> There's definitely more room for improvements. :) >> Ouch. We can make sure (at runtime) that the rhs has the right size, > > That's what I thought, too. There's a couple of cases that we can handle > efficiently, and some where we can add runtime checks.
Done. http://hg.cython.org/cython-devel/file/tip/tests/run/arrayassign.pyx What's still missing is a way to unpack arbitrary iterables into an array, as in cdef int a[5] a = range(5) Stefan _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
