Serhiy Storchaka added the comment:

Ah, there is a way to create non-contiguous buffers.

>>> b = bytes(range(16))
>>> m = memoryview(b)
>>> m[::2].c_contiguous
False

> PyBUF_SIMPLE enforces contiguity.

Then contiguousity check in getbuffer() in Python/getargs.c is redundant. And 
in most cases the use of _PyBuffer_Converter() and PyObject_GetBuffer() could 
be replaced by the use of "y*" and "w*" format units.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22896>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to