[Cython] -dagss merge? + what next
Dag Sverre Seljebotn
dagss at student.matnat.uio.no
Tue Jul 29 20:42:10 CEST 2008
Stefan Behnel wrote:
> 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?
Any index (and compilation error if you use an index >= ndim).
>
>
>> This would be the primary for-loop mechanism:
>>
>> from cython import shape
>
> import? not cimport?
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?
Yes.
--
Dag Sverre
More information about the Cython-dev
mailing list