[issue23632] memoryview doesn't allow tuple-indexing

Serhiy Storchaka report at bugs.python.org
Thu Mar 19 07:56:50 CET 2015


Serhiy Storchaka added the comment:

It would be good to add examples with multidimensional memoryviews. For example:

>>> a = array.array('l', [-11111111, 22222222, -33333333, 44444444])
>>> m = memoryview(a).cast('B').cast('l', [2, 2])
>>> m[0, 0]
-11111111
>>> m[1, 0]
-33333333
>>> m[-1, -1]
44444444

----------

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


More information about the Python-bugs-list mailing list