[Cython] Can't assign memview cast to memview slice

2013-02-26 Thread Dave Hirschfeld
The following works: ``` %%cython cimport cython import numpy as np cimport numpy as np def f(double[:,:] arr): cdef double[:] res = np.zeros(2*arr.size, dtype=np.float64) cdef double[:] tmp tmp = &arr[0,0] res[:arr.size] = tmp return res ``` whereas the following: ``` %%cyt

Re: [Cython] [cython-users] freelist benchmarks

2013-02-26 Thread Robert Bradshaw
On Mon, Feb 25, 2013 at 1:17 AM, Stefan Behnel wrote: > Hi, > > thanks for looking through it. > > David Roe, 25.02.2013 00:00: >> I changed the current type pointer check to look at tp_basicsize instead. >> >>> That made it work for almost all classes in lxml's own Element hierarchy, >>> with onl

Re: [Cython] [cython-users] freelist benchmarks

2013-02-26 Thread Stefan Behnel
Robert Bradshaw, 26.02.2013 21:16: > On Mon, Feb 25, 2013 at 1:17 AM, Stefan Behnel wrote: >> David Roe, 25.02.2013 00:00: >>> I changed the current type pointer check to look at tp_basicsize instead. >>> That made it work for almost all classes in lxml's own Element hierarchy, with only