[Numpy-discussion] PyBUF_SIMPLE requests

Pauli Virtanen pav at iki.fi
Mon Jul 18 06:39:34 EDT 2011


Sat, 16 Jul 2011 12:42:36 +0200, Stefan Krah wrote:
> x = ndarray(buffer=bytearray([1,2,3,4,5,6,7,8,9,10]),
>             shape=[10], strides=[-1], dtype="B", offset=9)
[clip]
> I do not understand the PyBUF_SIMPLE result. According to the C-API docs
> a consumer would be allowed to access buf[9], which would be invalid.

It's a bug in the Numpy implementation. The correct behavior here seems
to be that exporting the buffer must fail: there is no way to represent
this buffer with the requirements of PyBUF_SIMPLE.

	Pauli




More information about the NumPy-Discussion mailing list