[Cython] -dagss merge? + what next

Stefan Behnel stefan_ml at behnel.de
Tue Jul 29 20:29:57 CEST 2008


Hi,

Dag Sverre Seljebotn wrote:
> - shape(buf) -- Returns a tuple containing the shape of the buffer. 
> However, shape(buf)[0] should compile directly to __pyx_bshape0_buf.

Do you mean any index access here or is the first item special in any way?


> This would be the primary for-loop mechanism:
> 
> from cython import shape

import? not cimport?


> - buffer(buf), strides(buf), suboffsets(buf) -- Could have these to 
> allow low-level access (buffer gets a void* directly, strides and 
> suboffsets probably).

"buffer" is actually a builtin in Py2 and was replaced by "memoryview" in Py3
(so I would consider it free for future use, especially since it's namespaced
here).

I assume that you meant it to provide direct access to the plain buffer
"void*", right?

Stefan



More information about the Cython-dev mailing list