[issue4580] slicing of memoryviews when itemsize != 1 is wrong

Travis Oliphant report at bugs.python.org
Wed Dec 10 16:13:35 CET 2008


Travis Oliphant <oliphant at enthought.com> added the comment:

My perspective on statements made:
 
 * Memoryview object should report it's length as self->view.shape[0]
unless self->view.shape is NULL (indicating in this case a 0-d array or
scalar).  In this case, it should raise an error. 

 * The buffer protocol is clear about who owns the memory for shape and
strides (and suboffsets).  The exporter does and it is responsible for
not changing them until releasebuffer is called.

 * It should also be clear that shape, strides, and suboffsets will be
NULL in exactly two cases
   1) The corresponding flag was not set indicating the consumer is not
interested in shape, strides, or suboffsets
   2) ndim == 0 indicating a 0-dimensional array (scalar-like).

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4580>
_______________________________________


More information about the Python-bugs-list mailing list