[issue22445] Memoryviews require more strict contiguous checks then necessary

Stefan Krah report at bugs.python.org
Sat Sep 20 00:00:35 CEST 2014


Stefan Krah added the comment:

Thanks, #12845 is indeed fixed in NumPy.


Why does NumPy consider an array with a stride that will almost
certainly lead to undefined behavior (unless you compile with
-fwrapv) as valid?

In CPython we try to eliminate these kinds of issues (though
they may still be present).


>>> import numpy as np
import io

x = np.arange(10)
y = np.array([x])

print(y.strides)
(9223372036854775807, 8)
>>> 
>>> 
>>> y.flags
  C_CONTIGUOUS : True
  F_CONTIGUOUS : True
  OWNDATA : True
  WRITEABLE : True
  ALIGNED : True
  UPDATEIFCOPY : False

----------

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


More information about the Python-bugs-list mailing list