[Python-Dev] Allocation of shape and strides fields in Py_buffer (original) (raw)

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Dec 11 00:56:04 CET 2008


Travis Oliphant wrote:

When a slice view is made, a new memoryview object is created with a Pybuffer structure that needs to allocate it's own shape and strides (or something that will allow correct shape and strides to be reported to any consumer). In this way, there are two Pybuffer structures.

To be precise, the important thing is for the memoryview to allocate its own shape and strides. It's not strictly necessary to keep them internally in a Py_buffer struct, although that may be a convenient way to do it.

-- Greg



More information about the Python-Dev mailing list