[issue23352] PyBuffer_IsContiguous() sometimes returns wrong result if suboffsets != NULL

Stefan Krah report at bugs.python.org
Sat Jan 31 18:53:23 CET 2015


Stefan Krah added the comment:

Prepare for a partial reversal of opinion. :)


Indexing *can* actually create all-negative suboffsets in a natural way:


>>> from _testbuffer import *
>>> nd = ndarray([1,2,3,4,5,6,7,8,9,10,11,12], shape=[3,4], flags=ND_PIL)
>>> nd.tolist()
[[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]]
>>> 
>>> x = nd[1]
>>> x.tolist()
[5, 6, 7, 8]
>>> x.suboffsets
(-1,)
>>> 


This leaves me +-0 for the change, with the caveat that applications
might break.

----------

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


More information about the Python-bugs-list mailing list