[issue19078] Allow reversed(memoryview), like memoryview

Claudiu.Popa report at bugs.python.org
Wed Sep 25 15:06:26 CEST 2013


Claudiu.Popa added the comment:

So, in the following case, len shouldn't return 4, but the number of items? Also, is it ok to assume that the number of items is
((*shape)[0] * ... * (*shape)[ndims-1])?

>>> x = np.array([[1, 2, 3], [4, 5, 6], [4,5,6], [4,4,4]], np.int32)
>>> x.shape
(4, 3)
>>> x.shape[0] * x.shape[1]
12
>>> len(x)
4
>>> memoryview(x)
<memory at 0x0217C378>
>>> len(memoryview(x))
4
>>> memoryview(x).shape
(4, 3)
>>>

----------

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


More information about the Python-bugs-list mailing list