[New-bugs-announce] [issue12834] memoryview.tobytes() incorrect for non-contiguous arrays

Stefan Krah report at bugs.python.org
Wed Aug 24 20:45:05 CEST 2011


New submission from Stefan Krah <stefan-usenet at bytereef.org>:

memoryview.tobytes() converts a non-contiguous array to
a contiguous representation. This result is not right:


>>> from numpy import *
>>> x = array([1,2,3,4,5], dtype="B")
>>> y = x[::-1]
>>> y
array([5, 4, 3, 2, 1], dtype=uint8)
>>> m = memoryview(y)
>>> m.tobytes()
'\x04\x03\x02\x01\x05'
>>>

----------
assignee: skrah
components: Interpreter Core
messages: 142894
nosy: skrah
priority: normal
severity: normal
stage: needs patch
status: open
title: memoryview.tobytes() incorrect for non-contiguous arrays
type: behavior
versions: Python 3.3

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


More information about the New-bugs-announce mailing list