Dag Sverre Seljebotn wrote:
> Your GSoC would then Cython-side consist more or less of
> 
> a) #177, with new syntax
> b) A generic mechanism for automatic coercion between buffers of different
> modes. That is:
> 
> cdef int[::contiguous] buf # new syntax for mode="c" w/o Python obj?
> buf = some_object
> 
> Here, if the buffer of some_object is not contiguous, a contiguous copy
> will be made! And when releasing buf, it would be copied back.

BTW, I want to make it clear that I /am/ moving around a bit here myself 
and am still considering the best way of getting Fortran support and PEP 
3118 buffers working together in the best way possible. By thinking 
aloud you'll hopefully pick up on the design constrains around 
buffers-in-Cython as we go; I don't expect it all to be clear right now.

Anyway, b) above is not good, it raises a lot of questions on semantics 
(what is int[:] really -- a reference to memory or the memory itself -- 
what happens if one acquires two buffers simultaneously, do they point 
to the same memory -- etc). So replace b) above with:

b) A mechanism for automatically making contiguous copy-in/copy-out on 
#177-style method calls if necesarry.

-- 
Dag Sverre
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to